Files
sarlinkportal/.build/prod/api.Dockerfile
T
2026-08-02 05:09:00 +05:00

26 lines
689 B
Docker

FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
WORKDIR /app
# netcat is used by entrypoint.sh to wait for postgres
RUN apt-get update \
&& apt-get install -y --no-install-recommends netcat-openbsd \
&& rm -rf /var/lib/apt/lists/*
COPY backend/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY backend/ .
# Build the WhiteNoise manifest (staticfiles/staticfiles.json) so /static/ works.
RUN python manage.py collectstatic --noinput
COPY .build/prod/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["gunicorn", "apibase.wsgi:application", "--bind", "0.0.0.0:5000", "--workers", "4"]