-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
73 lines (71 loc) · 1.71 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
version: '3.7'
services:
backend:
build: ./backend
restart: on-failure
env_file: ./backend/.env
environment:
REDIS_HOST: redis
REDIS_PORT: 6379
WAIT_HOSTS: mongodb:27017, redis:6379
devices:
- "/dev/ttyUSB0:/dev/ttyUSB0"
networks:
- default
- backend
ports:
- '4000:4000/tcp'
links:
- mongodb
- redis
healthcheck:
test: ["CMD", "node", "/app/healthcheck.js"]
interval: 1s
timeout: 3s
retries: 5
start_period: 600s
mongodb:
image: mongo:4-focal
restart: on-failure
environment:
MONGO_INITDB_ROOT_USERNAME: banklessbackend
MONGO_INITDB_ROOT_PASSWORD: password
volumes:
- persist:/data/db
networks:
- backend
ports:
- '27017:27017/tcp'
redis:
image: redis:latest
restart: on-failure
command: redis-server --save 20 1 --loglevel warning
volumes:
- cache:/data
networks:
- backend
ports:
- '6379:6379/tcp'
frontend:
build: ./frontend
restart: on-failure
networks:
- default
ports:
- '80:4173/tcp'
healthcheck:
test:
- CMD-SHELL
- '[ "$(curl -sf http://localhost:4173 | wc -c)" -ge 100 ] || exit 1'
interval: 1s
timeout: 3s
retries: 5
start_period: 600s
networks:
backend:
driver: bridge
volumes:
cache:
driver: local
persist:
driver: local