Optimized size.

This commit is contained in:
Eugene Morozov 2023-08-08 01:46:41 +03:00
parent e7f0beb38a
commit ba5251657e
Signed by: jmv
GPG Key ID: 3FD81BB20ED80231
2 changed files with 11 additions and 4 deletions

View File

@ -6,12 +6,19 @@ COPY . /app/src
WORKDIR /app/src
RUN poetry config virtualenvs.create false && \
RUN poetry config virtualenvs.in-project true && \
poetry install --no-interaction --no-ansi
RUN ./manage.py collectstatic --noinput
RUN /app/src/.venv/bin/python manage.py collectstatic --noinput
CMD ./manage.py runserver 0.0.0.0:8080
FROM python:3.11-alpine3.18 AS django-api
COPY --from=django-static-builder /app/src /app/src/
WORKDIR /app/src
CMD /app/src/.venv/bin/python manage.py runserver 0.0.0.0:8080
FROM nginx:1.25.1-alpine AS front

View File

@ -1,7 +1,7 @@
services:
staticfiles-api:
build:
target: django-static-builder
target: django-api
image: staticfiles-api:develop
restart: unless-stopped