diff --git a/.build/prod/api.Dockerfile b/.build/prod/api.Dockerfile index 5b3cf04..afd6ad1 100644 --- a/.build/prod/api.Dockerfile +++ b/.build/prod/api.Dockerfile @@ -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