-
Notifications
You must be signed in to change notification settings - Fork 32
/
compose.yml
70 lines (63 loc) · 2.39 KB
/
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
# 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: develop}
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: [{path: .env, required: false}]
entrypoint: sh -c 'go build -buildvcs=false -o /var/tmp/app ./cmd/webhook-tester/ && exec $0 "$@"'
command: /var/tmp/app 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', '/var/tmp/app', 'start', 'healthcheck']
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
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
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:7-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: {}