-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
66 lines (63 loc) · 1.84 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
version: '3'
x-common-variables: &common-variables
FRONTEND_PORT: ${FRONTEND_PORT}
# MongoDB
DB_PORT: ${DB_PORT:-27017}
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
MONGO_INITDB_DATABASE: ${MONGO_INITDB_DATABASE}
services:
smiler-frontend:
# If both image and build specified then it will try to get the image from Docker Hub
# and if it doesn't exist there it will build a new one using Dockerfile from provided folder
restart: always
image: darkzarich/smiler-frontend:latest
build: ./client
container_name: smiler-frontend
environment:
API_URL: ${API_URL}
<<: *common-variables
depends_on:
- smiler-backend
networks:
- app
smiler-backend:
image: darkzarich/smiler-backend:latest
build: ./server
container_name: smiler-backend
environment:
NODE_ENV: production
BACKEND_PORT: ${BACKEND_PORT}
SESSION_SECRET: ${SESSION_SECRET}
FRONT_ORIGIN_REMOTE: ${FRONT_ORIGIN_REMOTE}
DB_URL: mongodb://${MONGO_INITDB_ROOT_USERNAME}:${MONGO_INITDB_ROOT_PASSWORD}@smiler-db:${DB_PORT}/${MONGO_INITDB_DATABASE}?authSource=admin
<<: *common-variables
restart: always
volumes:
- /data/smiler/logs:/usr/src/app/logs:rw
- /data/uploads/smiler:/usr/src/app/uploads:rw
networks:
- app
- db
depends_on:
smiler-db:
condition: service_healthy
smiler-db:
image: mongo:5.0.10
restart: always
container_name: smiler-db
volumes:
- /data/smiler/db:/data/db:rw
networks:
- db
environment:
<<: *common-variables
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh smiler-db:${DB_PORT} --quiet
interval: 10s
timeout: 10s
retries: 5
start_period: 40s
networks:
app:
db: