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

44 lines
890 B
YAML
Raw 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}"]
interval: 10s
timeout: 5s
retries: 5
2024-02-01 22:09:09 +00:00
app:
build:
dockerfile: Dockerfile
context: .
target: dev
args:
- GO_VERSION=${GO_VERSION}
ports:
- 1234:1234
volumes:
- .:/app
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
- PORT=1234
swagger:
image: swaggerapi/swagger-ui
ports:
- 1235:8080
environment:
- SWAGGER_JSON=/api/openapi.yaml
volumes:
- ./api:/api
depends_on:
- app