services: app: build: context: . dockerfile: Dockerfile ports: - "8080:8080" environment: - GIN_MODE=release - PORT=8080 - DATABASE_TYPE=postgres - DATABASE_HOST=postgres - DATABASE_USER=gin-template - DATABASE_PASSWORD=xxxxxxxxxx - DATABASE_DBNAME=gin-template - DATABASE_PORT=5432 - DATABASE_SSLMODE=disable depends_on: - postgres networks: - app-network restart: unless-stopped postgres: image: postgres:15-alpine environment: - POSTGRES_USER=gin-template - POSTGRES_PASSWORD=xxxxxxxxxx - POSTGRES_DB=gin-template ports: - "5432:5432" volumes: - postgres-data:/var/lib/postgresql/data networks: - app-network restart: unless-stopped healthcheck: test: ["CMD-SHELL", "pg_isready -U gin-template"] interval: 10s timeout: 5s retries: 5 redis: image: redis:7-alpine ports: - "6379:6379" networks: - app-network restart: unless-stopped volumes: - redis-data:/data networks: app-network: driver: bridge volumes: postgres-data: redis-data: