2021-09-29 15:38:50 +00:00
|
|
|
# Docker-compose file is used only for local development. This is not production-ready example.
|
|
|
|
|
2021-10-20 13:32:56 +00:00
|
|
|
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
|
2022-06-05 09:22:08 +00:00
|
|
|
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>
|
2022-06-12 07:55:49 +00:00
|
|
|
command: sh -c "go build -o /tmp/app ./cmd/error-pages && /tmp/app serve"
|
2021-09-29 15:38:50 +00:00
|
|
|
healthcheck:
|
2022-06-12 07:55:49 +00:00
|
|
|
test: ['CMD', '/tmp/app', 'healthcheck', '--log-json']
|
|
|
|
interval: 4s
|
|
|
|
timeout: 1s
|
|
|
|
start_period: 5s
|
2021-09-29 15:38:50 +00:00
|
|
|
|
|
|
|
golint:
|
2022-06-12 07:55:49 +00:00
|
|
|
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
|
2022-01-27 12:29:49 +00:00
|
|
|
|
|
|
|
hurl:
|
2022-06-12 08:11:52 +00:00
|
|
|
image: orangeopensource/hurl:1.6.1
|
2022-01-27 12:29:49 +00:00
|
|
|
volumes:
|
|
|
|
- .:/src:ro
|
|
|
|
working_dir: /src
|
|
|
|
depends_on:
|
2022-06-12 07:55:49 +00:00
|
|
|
web: {condition: service_healthy}
|