add prod and dev compose
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
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"]
|
||||
Reference in New Issue
Block a user