Files
geoip-rest/docker-compose.yml
2025-12-09 13:51:25 +09:00

36 lines
890 B
YAML

services:
postgres:
build:
context: .
dockerfile: Dockerfile.postgres
environment:
- POSTGRES_DB=geoip
- POSTGRES_USER=geoip_admin
- POSTGRES_PASSWORD=geoip_admin
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
- ./GeoLite2-City.mmdb:/data/GeoLite2-City.mmdb:ro
- ./deploy/postgres/init:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U geoip_admin -d geoip"]
interval: 5s
timeout: 5s
retries: 5
api:
build: .
depends_on:
postgres:
condition: service_healthy
ports:
- "8080:8080"
environment:
- PORT=8080
- GEOIP_BACKEND=postgres
- DATABASE_URL=postgres://geoip_readonly:geoip_readonly@postgres:5432/geoip?sslmode=disable
- GEOIP_DB_PATH=/data/GeoLite2-City.mmdb
volumes:
pgdata: