-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathcompose.yml
More file actions
78 lines (71 loc) · 2.45 KB
/
Copy pathcompose.yml
File metadata and controls
78 lines (71 loc) · 2.45 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
# yaml-language-server: $schema=https://cdn.jsdelivr.net/gh/compose-spec/compose-spec@master/schema/compose-spec.json
services:
app: # common use case is to run shell or execute commands
build: &app-build {dockerfile: Dockerfile, target: builder}
env_file: &app-env-file [{path: .env, required: false}]
environment: {HOME: /tmp, LOG_LEVEL: debug}
volumes: [.:/src:rw, app-tmp-data:/tmp:rw, app-modules-cache:/var/tmp/go:rw]
security_opt: [no-new-privileges:true]
app-http:
build: *app-build
env_file: *app-env-file
command: go run ./cmd/webhook-tester/ start --use-live-frontend --auto-create-sessions --max-requests 16
volumes: [.:/src:rw]
ports: ['8080:8080/tcp'] # open http://127.0.0.1:8080
healthcheck:
test: ['CMD', 'wget', '--spider', '-q', 'http://127.0.0.1:8080/healthz']
start_interval: 1s
interval: 10s
start_period: 10s
depends_on: {app-web-dist: {condition: service_healthy}}
security_opt: [no-new-privileges:true]
app-web-dist:
build: *app-build
env_file: *app-env-file
user: node
volumes: [.:/src:rw]
working_dir: /src/web
command: npm run watch
healthcheck:
test: ['CMD', 'test', '-f', './dist/robots.txt']
start_interval: 1s
interval: 10s
start_period: 20s
security_opt: [no-new-privileges:true]
app-web-serve:
build: *app-build
env_file: *app-env-file
user: node
volumes: [.:/src:rw]
working_dir: /src/web
environment: {DEV_SERVER_PROXY_TO: http://app-http:8080} # tell to vite dev server "where is the API"
command: npm run serve -- --host 0.0.0.0 --port 8080
ports: ['8081:8080/tcp'] # open http://127.0.0.1:8081
healthcheck:
test: ['CMD', 'wget', '--spider', '-q', 'http://127.0.0.1:8080']
start_interval: 1s
interval: 3s
start_period: 10s
security_opt: [no-new-privileges:true]
redis:
image: docker.io/library/redis:8-alpine
volumes: [redis-data:/data:rw]
ports: ['6379/tcp']
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 500ms
timeout: 1s
security_opt: [no-new-privileges:true]
k6:
image: ghcr.io/grafana/k6:latest
volumes: [.:/src:ro]
working_dir: /src
environment:
BASE_URL: http://app-http:8080
K6_NO_USAGE_REPORT: 'true'
depends_on: {app-http: {condition: service_healthy}}
security_opt: [no-new-privileges:true]
volumes:
app-modules-cache: {}
app-tmp-data: {}
redis-data: {}