forked from tarampampam/webhook-tester
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
100 lines (91 loc) · 2.86 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
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
# Docker-compose file is used only for local development. This is not production-ready example
version: '3.8'
volumes:
tmp-data: {}
redis-data: {}
golint-go: {}
golint-cache: {}
node-data: {}
services:
go: &go
build:
target: builder
args: [DEV_MODE=true]
working_dir: /src
environment:
PS1: '\[\033[1;32m\]\[\033[1;36m\][\u@go] \[\033[1;34m\]\w\[\033[0;35m\] \[\033[1;36m\]# \[\033[0m\]'
HOME: /tmp
GOPATH: /tmp
volumes:
- /etc/passwd:/etc/passwd:ro
- /etc/group:/etc/group:ro
- tmp-data:/tmp:rw
- .:/src:rw
depends_on: &go-deps
redis: {condition: service_healthy}
security_opt: [no-new-privileges:true]
node: &node
build: {target: frontend}
environment:
PS1: '\[\033[1;32m\]\[\033[1;36m\][\u@node] \[\033[1;34m\]\w\[\033[0;35m\] \[\033[1;36m\]# \[\033[0m\]'
HOME: /tmp
NPM_CONFIG_UPDATE_NOTIFIER: false
volumes:
- /etc/passwd:/etc/passwd:ro
- /etc/group:/etc/group:ro
- node-data:/tmp:rw
- .:/src:rw
working_dir: /src/web
security_opt: [no-new-privileges:true]
web:
<<: *go
ports: ['8080:8080/tcp'] # Open <http://127.0.0.1:8080>
command: >-
go run -tags watch ./cmd/webhook-tester/ serve
--port=8080 --storage-driver=redis --pubsub-driver=redis
--redis-dsn=redis://redis:6379/0 --max-requests=112 --ignore-header-prefix=x-test-foo --ws-max-clients=20
--ws-max-lifetime=1m
healthcheck:
test: ['CMD-SHELL', 'wget --spider -q http://127.0.0.1:8080/ready']
start_period: 5s
interval: 5s
retries: 5
depends_on:
<<: *go-deps
node-watch: {condition: service_healthy}
node-watch:
<<: *node
command: npm run watch
healthcheck:
test: ['CMD-SHELL', 'test -d ./dist']
interval: 3s
start_period: 5s
retries: 20
redis:
image: 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]
golint:
image: golangci/golangci-lint:v1.54-alpine # Image page: <https://hub.docker.com/r/golangci/golangci-lint>
environment:
GOLANGCI_LINT_CACHE: /tmp/golint # <https://github.com/golangci/golangci-lint/blob/v1.33.0/internal/cache/default.go#L68>
volumes:
- golint-go:/go:rw # go dependencies will be downloaded on each run without this
- golint-cache:/tmp/golint:rw
- .:/src:ro
working_dir: /src
security_opt: [no-new-privileges:true]
hurl:
image: orangeopensource/hurl:1.8.0
entrypoint: ""
command: sh -c "hurl --color --test --variable host=web --variable port=8080 ./test/hurl/*/*.hurl"
volumes: [.:/src:ro]
working_dir: /src
depends_on:
web: {condition: service_healthy}
security_opt: [no-new-privileges:true]