-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
98 lines (96 loc) · 2.29 KB
/
Copy pathcompose.yaml
File metadata and controls
98 lines (96 loc) · 2.29 KB
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
# https://docs.docker.com/go/compose-spec-reference/
# For examples, see the Awesome Compose repository:
# https://github.com/docker/awesome-compose
services:
backend-dev:
profiles:
- dev
volumes:
- type: bind
source: backend
target: /usr/app/backend
extends:
file: common.yaml
service: backend-template
build:
target: dev
backend-prod:
profiles:
- prod
extends:
file: common.yaml
service: backend-template
build:
target: prod
frontend-dev:
profiles:
- dev
build:
context: frontend
target: dev
environment:
NODE_ENV: development
volumes:
- type: bind
source: frontend/index.html
target: /usr/app/frontend/index.html
- type: bind
source: frontend/src
target: /usr/app/frontend/src
ports:
- 5173:5173
depends_on:
backend-dev:
condition: service_healthy
frontend-prod:
profiles:
- prod
build:
context: frontend
target: prod
environment:
NODE_ENV: production
ports:
- 5173:80
depends_on:
backend-prod:
condition: service_healthy
mongodb:
image: mongodb/mongodb-community-server:6.0.23-ubuntu2204
restart: always
# user: postgres
# secrets:
# - db-password
env_file:
- backend/.env.docker
# environment:
# - MONGODB_INITDB_ROOT_USERNAME_FILE=/run/secrets/db-username
# - MONGODB_INITDB_ROOT_PASSWORD_FILE=/run/secrets/db-password
# # TODO make this secure MONGODB_INITDB_ROOT_USERNAME_FILE,MONGODB_INITDB_ROOT_PASSWORD_FILE
# - MONGODB_INITDB_ROOT_USERNAME=user
# - MONGODB_INITDB_ROOT_PASSWORD=pass
# volumes:
# - type: bind
# source: ./data
# target: /data/db
# environment:
# - POSTGRES_DB=example
# - POSTGRES_PASSWORD_FILE=/run/secrets/db-password
expose:
- 27017
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh $$MONGODB_URI --quiet
interval: 10s
timeout: 10s
retries: 5
start_period: 40s
# secrets:
# - db-password
# - db-username
# secrets:
# db-password:
# file: secrets/db-password.txt
# db-username:
# file: secrets/db-username.txt
# # volumes:
# db-data: