-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
86 lines (78 loc) · 1.77 KB
/
docker-compose.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
79
80
81
82
83
84
85
86
version: '3'
services:
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.prod
container_name: realworld-docker-frontend
command: serve -s build -l 3000
# ports:
# - "3000:3000"
restart: unless-stopped
networks:
- realworld-docker-network
api:
build: ./api
container_name: realworld-docker-api
command: npm run start
restart: unless-stopped
# ports:
# - "3001:3001"
environment:
- PORT=3001
# - HOST=http://realworld-docker.com
- MONGO_URL=mongodb://api_db:27017/api
- AUTH_API_URL=http://auth:3002/api
depends_on:
- api_db
networks:
- realworld-docker-network
auth:
build: ./auth
container_name: realworld-docker-auth
command: npm run start
restart: unless-stopped
# ports:
# - "3002:3002"
environment:
- PORT=3002
# - HOST=http://realworld-docker.com
- MONGO_URL=mongodb://auth_db:27017/auth
- API_URL=http://api:3001/api
depends_on:
- auth_db
networks:
- realworld-docker-network
api_db:
image: mongo:latest
container_name: realworld-docker-api-db
volumes:
- mongodb_api:/data/db
networks:
- realworld-docker-network
auth_db:
image: mongo:latest
container_name: realworld-docker-auth-db
volumes:
- mongodb_auth:/data/db
networks:
- realworld-docker-network
nginx:
image: nginx:stable-alpine
container_name: realworld-docker-nginx
ports:
- "80:80"
volumes:
- ./nginx/nginx.conf.prod:/etc/nginx/conf.d/nginx.conf
depends_on:
- frontend
- api
- auth
networks:
- realworld-docker-network
volumes:
mongodb_api:
mongodb_auth:
networks:
realworld-docker-network:
driver: bridge