Browse Source

Improve build speed

pull/1110/head
Hironsan 4 years ago
parent
commit
ff023ba7ec
2 changed files with 13 additions and 8 deletions
  1. 18
      app/Dockerfile
  2. 3
      docker-compose.prod.yml

18
app/Dockerfile

@ -1,4 +1,5 @@
FROM alpine:3.9.6
ARG PYTHON_VERSION="3.8.6"
FROM python:${PYTHON_VERSION}-slim-buster
CMD ["python3"]
@ -9,8 +10,13 @@ ENV PYTHONUNBUFFERED 1
COPY . /app/
RUN apk add -U --no-cache bash python3 python3-dev libpq postgresql-dev unixodbc-dev musl-dev g++ libffi-dev \
&& pip3 install --upgrade --no-cache-dir pip setuptools \
&& pip3 install --no-cache-dir -r requirements.txt \
&& ln -s /usr/bin/python3 /usr/bin/python \
&& apk del --no-cache python3-dev postgresql-dev unixodbc-dev musl-dev g++ libffi-dev
# hadolint ignore=DL3013
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
netcat=1.10-41.1 \
libpq-dev=11.9-0+deb10u1 \
unixodbc-dev=2.3.6-0.1 \
g++=4:8.3.0-1 \
&& pip install --no-cache-dir -U pip setuptools \
&& pip install --no-cache-dir -r requirements.txt \
&& apt-get clean

3
docker-compose.prod.yml

@ -23,10 +23,9 @@ services:
build: ./frontend
environment:
API_URL: "http://backend:8000"
GOOGLE_TRACKING_ID: ""
volumes:
- www:/app/dist
environment:
GOOGLE_TRACKING_ID: ""
nginx:
build: ./nginx

Loading…
Cancel
Save