You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

31 lines
784 B

FROM python:3.12-slim
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONPATH=/app/backend
WORKDIR /app
# Copy requirements file first
COPY requirements.txt .
# Install build dependencies for psycopg2, install pip requirements, then clean up build tools
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
python3-dev \
libpq-dev \
libpq5 \
&& pip install --no-cache-dir -r requirements.txt \
&& apt-get purge -y --auto-remove gcc python3-dev libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy entrypoint script and set executable permissions
COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
# Copy backend source code
COPY backend /app/backend
EXPOSE 8000
ENTRYPOINT ["/app/entrypoint.sh"]