-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
44 lines (39 loc) · 1.29 KB
/
docker-compose.prod.yml
File metadata and controls
44 lines (39 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
version: '3.7'
### Compose para AWS #######################################
services:
### nodejs Container #######################################
nodejs:
build:
context: ./docker/nodejs
args:
- ENVIRONMENT=${ENVIRONMENT}
volumes:
- ./:/var/www
### Nginx Server Container ##################################
nginx:
build:
context: ./docker/nginx
volumes:
- ${APPLICATION}:/var/www:cached
- ${NGINX_HOST_LOG_PATH}:/var/log/nginx
- ${NGINX_SITES_PATH}:/etc/nginx/sites-available
- ${NGINX_SSL_PATH}:/etc/nginx/ssl
- ${APP_WEB_PATH}:/var/www/.front-end:cached
depends_on:
- nodejs
environment:
- SERVER_NAME=${SERVER_NAME}
- NODE_CONTAINER_NAME=${NODE_CONTAINER_NAME}
#é a única forma de passar variáveis de ambiente para a conf do nginx, lembre-se de escapar com $$ as variáveis
command: /bin/bash -c "envsubst '$$SERVER_NAME $$NODE_CONTAINER_NAME' < /etc/nginx/sites-available/.default.conf.template > /etc/nginx/sites-available/default.conf && exec nginx"
restart: always
ports:
- 80:80
- 443:443
### Redis ################################################
redis:
build: ./docker/redis
volumes:
- ${DATA_SAVE_PATH}/redis:/data
networks:
- backend