error-pages/docker-compose.yml

50 lines
1.3 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-cache: {}
2020-07-08 17:15:53 +00:00
services:
2021-09-29 15:38:50 +00:00
app: &app-service
image: golang:1.18-buster # Image page: <https://hub.docker.com/_/golang>
2020-07-08 17:15:53 +00:00
working_dir: /src
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
web:
<<: *app-service
ports:
- "8080:8080/tcp" # Open <http://127.0.0.1:8080>
command: sh -c "go build -o /tmp/app ./cmd/error-pages && /tmp/app serve"
2021-09-29 15:38:50 +00:00
healthcheck:
test: ['CMD', '/tmp/app', 'healthcheck', '--log-json']
interval: 4s
timeout: 1s
start_period: 5s
2021-09-29 15:38:50 +00:00
golint:
image: golangci/golangci-lint:v1.46-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:
- .:/src:ro
- golint-cache:/tmp/golint:rw
working_dir: /src
command: /bin/true
hurl:
image: orangeopensource/hurl:1.6.1
volumes:
- .:/src:ro
working_dir: /src
depends_on:
web: {condition: service_healthy}