update dockerfile
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 2m39s

This commit is contained in:
Shihaam Abdul Rahman 2025-03-14 23:53:08 +05:00
parent 7083d67c9a
commit 906644b7c7
Signed by: shihaam
GPG Key ID: 6DA2E87EBC227636

View File

@ -2,37 +2,18 @@ FROM python:3.11.4-slim-buster AS builder
WORKDIR /var/www/html/
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
COPY . .
RUN apt-get update && \
apt-get install -y --no-install-recommends gcc
RUN pip install -r requirements.txt
RUN pip install --upgrade pip
COPY . /var/www/html/
COPY ./requirements.txt .
RUN pip wheel --no-cache-dir --no-deps --wheel-dir /var/www/html/wheels -r requirements.txt
## aidhaan pls fix having to require this.
ENV EMAIL_HOSTNAME ""
ENV EMAIL_PORT "12312"
ENV EMAIL_USERNAME ""
ENV EMAIL_PASSWORD ""
FROM python:3.11.4-slim-buster
RUN python3 manage.py collectstatic
WORKDIR /var/www/html/
VOLUME /var/www/html/staticfiles/
RUN mkdir /var/www/html/staticfiles -p && chmod -R 777 /var/www/html/staticfiles
RUN apt-get update && apt-get install -y --no-install-recommends netcat
COPY --from=builder /var/www/html/wheels /wheels
COPY --from=builder /var/www/html/requirements.txt .
RUN pip install --upgrade pip
RUN pip install --no-cache /wheels/*
COPY . /var/www/html/
# copy entrypoint.prod.sh
COPY .build/prod/entrypoint.sh /entrypoint.sh
#RUN python manage.py collectstatic
ENTRYPOINT ["/entrypoint.sh"]
VOLUME /var/www/html/staticfiles
CMD gunicorn apibase.wsgi:application --bind 0.0.0.0:5000 --workers=2
CMD gunicorn apibase.wsgi:application --bind 0.0.0.0:4000 --workers=4