-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
87 lines (81 loc) · 1.82 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
87
# Production Compose File
version: '3.8'
services:
# nginx
client:
container_name: drawhub_client
depends_on:
- server # for reverse proxy
build:
context: .
# reference the image in the last build stage
cache_from:
- nginx:1.23.0-alpine
dockerfile: ./apps/client/Dockerfile
image: drawhub/client:latest
ports:
# exposed port 4200
# nginx internal port 80
- 4200:80
networks:
- app
restart: always
env_file:
- .env
# node (uses base image)
server:
container_name: drawhub_server
depends_on:
- mongo
build:
context: .
# reference the image in the last build stage
cache_from:
- node:16.15.1-alpine3.16
dockerfile: ./apps/server/Dockerfile
image: drawhub/server:latest
ports:
- 3333:3333
environment:
- PORT=3333
# `mongo` refers to container name
# since its outside of this container's localhost
- MONGO_URI=mongodb://drawhub:admin@drawhub_mongo:27017
- REDIS_URL=redis://drawhub_redis:6379
networks:
- app
restart: always
env_file:
- .env
# see: https://www.mongodb.com/compatibility/docker
mongo:
container_name: drawhub_mongo
image: mongo:latest
volumes:
- mongodata:/data/db
ports:
- 27017:27017
environment:
- MONGO_INITDB_ROOT_USERNAME=drawhub
- MONGO_INITDB_ROOT_PASSWORD=admin
networks:
- app
restart: always
redis:
container_name: drawhub_redis
image: redis:latest
volumes:
- redisdata:/var/lib/redis
ports:
- 6379:6379
networks:
- app
restart: always
networks:
app:
# default network driver:
# for standalone containers that need to communicate
driver: bridge
volumes:
mongodata:
redisdata: