# Use official Python runtime as a parent image FROM python:3.9-slim # Set the working directory in the container WORKDIR /app # Set environment variables ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 # Install system dependencies including PostgreSQL client and netcat RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ libpq-dev \ postgresql-client \ curl \ netcat-openbsd \ && rm -rf /var/lib/apt/lists/* # Install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy the current directory contents into the container at /app COPY . . # Copy and set up startup script COPY start.sh /app/start.sh RUN chmod +x /app/start.sh # Expose the port the app runs on EXPOSE 8002 # Run startup script CMD ["/app/start.sh"]