This repository has been archived on 2024-04-25. You can view files and clone it, but cannot push or open issues or pull requests.
golang-rest-example/docker-compose.yaml

41 lines
879 B
YAML
Raw Permalink Normal View History

2024-02-01 22:09:09 +00:00
version: "3.9"
services:
db:
image: postgres
restart: always
environment:
2024-02-02 14:39:13 +00:00
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${postgres_db} -u $${postgres_user}"]
2024-02-02 14:39:13 +00:00
interval: 10s
timeout: 5s
retries: 5
ports:
- 1233:5432
2024-02-01 22:09:09 +00:00
app:
image: golang-rest-example
2024-02-01 22:09:09 +00:00
build:
dockerfile: Dockerfile
context: .
args:
- GO_VERSION=${GO_VERSION}
ports:
- 1234:1234
2024-02-02 14:39:13 +00:00
depends_on:
db:
condition: service_healthy
2024-02-01 22:09:09 +00:00
environment:
2024-02-02 14:39:13 +00:00
- DATABASE_URL=postgresql://postgres:postgres@db:5432/postgres?sslmode=disable
swagger:
image: swaggerapi/swagger-ui
ports:
- 1235:8080
environment:
- SWAGGER_JSON=/openapi.yaml
2024-02-02 14:39:13 +00:00
volumes:
- ./api/openapi.yaml:/openapi.yaml:ro