error-pages/docker-compose.yml

53 lines
1.5 KiB
YAML
Raw Normal View History

2021-09-29 15:38:50 +00:00
# Docker-compose file is used only for local development. This is not production-ready example.
version: '3.8'
2020-07-08 17:15:53 +00:00
volumes:
2021-09-29 15:38:50 +00:00
tmp-data: {}
golint-go: {}
2021-09-29 15:38:50 +00:00
golint-cache: {}
2020-07-08 17:15:53 +00:00
services:
app: &go
build: {target: builder}
2020-07-08 17:15:53 +00:00
environment:
HOME: /tmp
2021-09-29 15:38:50 +00:00
GOPATH: /tmp
2020-07-08 17:15:53 +00:00
volumes:
- /etc/passwd:/etc/passwd:ro
- /etc/group:/etc/group:ro
2021-09-29 15:38:50 +00:00
- .:/src:rw
- tmp-data:/tmp:rw
security_opt: [no-new-privileges:true]
2021-09-29 15:38:50 +00:00
web:
<<: *go
2021-09-29 15:38:50 +00:00
ports:
- "8080:8080/tcp" # Open <http://127.0.0.1:8080>
command: sh -c "go build -buildvcs=false -o /tmp/app ./cmd/error-pages && /tmp/app serve --show-details --proxy-headers=X-Foo,Bar,Baz_blah --catch-all"
2021-09-29 15:38:50 +00:00
healthcheck:
test: ['CMD', '/tmp/app', '--log-json', 'healthcheck']
interval: 4s
start_period: 5s
retries: 5
2021-09-29 15:38:50 +00:00
golint:
image: golangci/golangci-lint:v1.57-alpine # Image page: <https://hub.docker.com/r/golangci/golangci-lint>
2021-09-29 15:38:50 +00:00
environment:
GOLANGCI_LINT_CACHE: /tmp/golint # <https://github.com/golangci/golangci-lint/blob/v1.42.0/internal/cache/default.go#L68>
volumes:
- golint-go:/go:rw # go dependencies will be downloaded on each run without this
2021-09-29 15:38:50 +00:00
- golint-cache:/tmp/golint:rw
- .:/src:ro
2021-09-29 15:38:50 +00:00
working_dir: /src
security_opt: [no-new-privileges:true]
hurl:
image: ghcr.io/orange-opensource/hurl:4.3.0
volumes:
- .:/src:ro
working_dir: /src
depends_on:
web: {condition: service_healthy}
security_opt: [no-new-privileges:true]