-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathdocker-compose-prod.yml
78 lines (78 loc) · 1.85 KB
/
docker-compose-prod.yml
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
version: "3"
services:
api:
build:
context: ./api
dockerfile: Dockerfile
command: npm run start-watch
volumes:
- ./api:/usr/app/
- /usr/app/node_modules
expose:
- "3000"
depends_on:
- mongo
environment:
NODE_ENV: production
MONGO_URL: mongodb://mongo:27017/${MONGO_INITDB_DATABASE}?authSource=admin
MONGO_USER: ${MONGO_USER}
MONGO_PWD: ${MONGO_PASSWORD}
IS_LOCAL: ${IS_LOCAL}
mongo:
image: mongo
restart: unless-stopped
env_file: .env
environment:
- MONGO_INITDB_ROOT_USERNAME=$MONGO_USERNAME
- MONGO_INITDB_ROOT_PASSWORD=$MONGO_PASSWORD
volumes:
- ./data/mongo:/data/db
expose:
- "27017"
nginx-proxy:
image: jwilder/nginx-proxy
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- certs:/etc/nginx/certs:ro
- vhostd:/etc/nginx/vhost.d
- html:/usr/share/nginx/html
labels:
- com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy
letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
restart: always
depends_on:
- nginx-proxy
environment:
- NGINX_PROXY_CONTAINER=nginx-proxy
volumes:
- certs:/etc/nginx/certs:rw
- vhostd:/etc/nginx/vhost.d
- html:/usr/share/nginx/html
- /var/run/docker.sock:/var/run/docker.sock:ro
webapp:
build:
context: ./webapp
dockerfile: Dockerfile
command: npm run start
volumes:
- ./webapp:/usr/app/
- /usr/app/node_modules
ports:
- "8080"
depends_on:
- api
environment:
- NODE_ENV=development
- VIRTUAL_HOST=pro.juaning.dev
- VIRTUAL_PORT=8080
- LETSENCRYPT_HOST=pro.juaning.dev
volumes:
certs:
html:
vhostd: