-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
109 lines (106 loc) · 3.34 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
services:
mongodb:
image: mongo:7
container_name: getaroom-mongodb
hostname: mongodb
volumes:
- ./db/mongodb-single/mongodb/initdb.d/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
env_file:
- .env
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
MONGO_INITDB_DATABASE: ${MONGO_INITDB_DATABASE}
ports:
- '${MONGO_LOCAL_PORT}:27017'
networks:
- getaroom_network
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 10s
timeout: 10s
retries: 2
start_period: 5s
mongo-express:
image: mongo-express:latest
container_name: getaroom-mongo-express
restart: always
environment:
- ME_CONFIG_MONGODB_SERVER=mongodb
- ME_CONFIG_MONGODB_URL=${ME_CONFIG_MONGODB_URL}
- ME_CONFIG_MONGODB_ADMINUSERNAME=${MONGO_INITDB_ROOT_USERNAME}
- ME_CONFIG_MONGODB_ADMINPASSWORD=${MONGO_INITDB_ROOT_PASSWORD}
- ME_CONFIG_BASICAUTH_PASSWORD=${MONGO_EXPRESS_PASSWORD}
- ME_CONFIG_MONGODB_PORT=27017
- ME_CONFIG_BASICAUTH_USERNAME=${MONGO_EXPRESS_USERNAME}
ports:
- 8081:8081
networks:
- getaroom_network
depends_on:
mongodb:
condition: service_healthy
backend:
env_file:
- .env
build:
context: .
dockerfile: ./dev.Dockerfile
args:
- DIR=backend
- TZ=${TZ}
container_name: getaroom-backend
hostname: backend
volumes:
- ./:/usr/src/app/
ports:
- '${BACKEND_LOCAL_PORT}:8080'
expose:
- ${BACKEND_LOCAL_PORT}
networks:
- getaroom_network
healthcheck:
test: curl --fail http://localhost:8080/api || exit 1
interval: 20s
retries: 5
start_period: 5s
timeout: 10s
depends_on:
mongodb:
condition: service_healthy
command: |
bash -c "
npm --prefix /usr/src/app/backend run generate_vapid_keys &&
export VAPID_PUBLIC_KEY="$(sed -n '1p' ../.vapidkey)" &&
export VAPID_PRIVATE_KEY="$(sed -n '2p' ../.vapidkey)" &&
npm run nodemon
"
frontend:
env_file:
- .env
build:
context: .
dockerfile: ./dev.Dockerfile
args:
- DIR=frontend
- TZ=${TZ}
container_name: getaroom-frontend
depends_on:
backend:
condition: service_healthy
hostname: frontend
volumes:
- ./:/usr/src/app/
ports:
- '${FRONTEND_LOCAL_PORT}:3000'
expose:
- ${FRONTEND_LOCAL_PORT}
networks:
- getaroom_network
command: |
bash -c "export VITE_REACT_APP_SERVER_KEY="$(sed -n '1p' ../.vapidkey)"
npm run start:docker --host"
networks:
getaroom_network:
driver: bridge
name: getaroom_network