-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
105 lines (99 loc) · 2.27 KB
/
compose.yaml
File metadata and controls
105 lines (99 loc) · 2.27 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
99
100
101
102
103
104
105
name: ViteDemo
# Note that when using compose extend to define services that
# inherit secrets mapping, the secrets must be defined in the main
# compose file, not the common compose file that defines the base
# service that consumes the secrets.
secrets:
secrets1:
file: ./back/secrets.json
services:
dev-front:
profiles:
- dev
depends_on:
- dev-back
extends:
file: ./common.yaml
service: front-base
build:
target: dev-stage
develop:
watch:
- path: ./front/src
action: sync
target: /app/src
- path: ./front/package.json
action: rebuild
# Start Vite's hot module replacement function
command: ["yarn", "dev"]
prd-front:
profiles:
- prd
depends_on:
- prd-back
extends:
file: ./common.yaml
service: front-base
build:
# Override extended base service attribute
args:
VITE_HOST: localhost
# It is assumed that the final image in the Dockerfile
# has Node's http-server package installed globally
command: ["http-server"]
dev-back:
profiles:
- dev
extends:
file: ./common.yaml
service: back-base
ports:
- "8081:8080"
build:
args:
VITE_HOST: 0.0.0.0
VITE_PORT: 8080
target: dev-stage
develop:
watch:
- path: ./back/src
action: sync
target: /app/src
- path: ./back/package.json
action: rebuild
command: ["yarn", "dev"]
prd-back:
profiles:
- prd
extends:
file: ./common.yaml
service: back-base
# For some reason, the ports between the host and the
# container need to match in production.
ports:
- "8081:8081"
build:
target: server
hc-back:
profiles:
- hc
extends:
file: ./common.yaml
service: back-base
ports:
- "8081:8081"
healthcheck:
test:
- CMD-SHELL
- >-
curl -f
--url http://localhost:8081/secrets
--request POST
--header 'Content-Type: application/json'
--header 'Referer: http://localhost:8080'
--data "{\"name\": \"SECRET\"}"
|| exit 1
interval: 5s
timeout: 10s
retries: 2
start_period: 10s