Browse Source

Update docker-compose.prod.yml to remove frontend container

pull/1147/head
Hironsan 4 years ago
parent
commit
1c8ef0c654
4 changed files with 19 additions and 23 deletions
  1. 1
      .dockerignore
  2. 14
      docker-compose.prod.yml
  3. 11
      frontend/Dockerfile
  4. 16
      nginx/Dockerfile

1
.dockerignore

@ -1,6 +1,7 @@
*
!app/
!frontend/
!nginx/
!tests/
!tools/
!.coveragerc

14
docker-compose.prod.yml

@ -5,7 +5,6 @@ services:
build:
context: .
dockerfile: app/Dockerfile.prod
# command: ["/app/tools/run.sh"]
volumes:
- static_volume:/app/staticfiles
environment:
@ -21,18 +20,14 @@ services:
- network-backend
- network-frontend
frontend:
build: ./frontend
nginx:
build:
context: .
dockerfile: nginx/Dockerfile
environment:
API_URL: "http://backend:8000"
GOOGLE_TRACKING_ID: ""
volumes:
- www:/app/dist
nginx:
build: ./nginx
volumes:
- www:/var/www/html:ro
- static_volume:/static
ports:
- 80:80
@ -55,7 +50,6 @@ services:
volumes:
postgres_data:
static_volume:
www:
networks:
network-backend:

11
frontend/Dockerfile

@ -1,11 +0,0 @@
FROM node:13.7-alpine
WORKDIR /app
COPY . /app/
RUN apk add -U --no-cache git python3 make g++ \
# && npm install -g yarn@latest \
&& yarn install \
&& yarn build \
&& apk del --no-cache git make g++

16
nginx/Dockerfile

@ -1,4 +1,16 @@
FROM nginx:1.17.4-alpine
ARG NODE_VERSION="13.7"
FROM node:${NODE_VERSION}-alpine AS frontend-builder
COPY frontend/ /app/
WORKDIR /app
RUN apk add -U --no-cache git python3 make g++ \
&& yarn install \
&& yarn build \
&& apk del --no-cache git make g++
FROM nginx:1.17.4-alpine AS runtime
COPY --from=frontend-builder /app/dist /var/www/html
RUN rm /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/conf.d
COPY nginx/nginx.conf /etc/nginx/conf.d
Loading…
Cancel
Save