mirror of
https://github.com/i701/sarlink-portal-api.git
synced 2025-04-19 23:46:53 +00:00
update dockerfile
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 2m39s
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 2m39s
This commit is contained in:
parent
7083d67c9a
commit
906644b7c7
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user