This repository has been archived by the owner on Mar 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yaml
96 lines (91 loc) · 2.11 KB
/
docker-compose.yaml
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
88
89
90
91
92
93
94
95
96
services:
app:
image: node:14-alpine
container_name: app
volumes:
- type: bind
source: ./api
target: /app
working_dir: /app
restart: always
user: "${USER_ID:-1000}:${GROUP_ID:-1000}"
depends_on:
db:
condition: service_healthy
npm:
condition: service_completed_successfully
command: [ 'npx', 'nodemon' ]
networks:
- backend
npm:
image: node:14-alpine
container_name: npm
volumes:
- type: bind
source: ./api
target: /app
working_dir: /app
restart: "no"
user: "${USER_ID:-1000}:${GROUP_ID:-1000}"
depends_on:
db:
condition: service_healthy
command: [ 'npm', 'i' ]
networks:
- backend
db:
image: mongo:6.0.2
container_name: db
restart: always
ports:
- protocol: tcp
published: ${MONGO_PORT}
target: 27017
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME:-web3idpre}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD:-password}
MONGO_INITDB_DATABASE: ${MONGO_INITDB_DATABASE:-web3idpre}
volumes:
- type: volume
source: mongo
target: /data/db
- type: bind
source: ./init/mongo-init.js
target: /docker-entrypoint-initdb.d/mongo-init.js
read_only: true
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 5s
timeout: 10s
retries: 50
start_period: 3s
networks:
- backend
proxy:
image: nginx:alpine
container_name: proxy
restart: always
ports:
- protocol: tcp
published: ${WEB_PORT}
target: 443
volumes:
- type: bind
source: ./nginx/proxy.conf
target: /etc/nginx/conf.d/default.conf
- type: bind
source: ${SSL_CRT}
target: /etc/nginx/ssl.crt
- type: bind
source: ${SSL_KEY}
target: /etc/nginx/ssl.key
networks:
- frontend
- backend
volumes:
mongo: {}
networks:
frontend:
driver: bridge
backend:
driver: bridge