[volumes]
files = {}
config = {}
redis = {}
db = {}

[services.firefish]
image = "registry.firefish.dev/firefish/firefish"
container_name = "firefish"
restart = "unless-stopped"
depends_on = ["redis"]
ports = ["3084:3000"]
networks = ["firefish", "proxy"]
environment = { NODE_ENV = "production" }
volumes = ["files:/firefish/files", "config:/firefish/.config:ro"]

[services.redis]
image = "redis"
container_name = "redis-firefish"
restart = "unless-stopped"
networks = ["firefish"]
volumes = ["redis:/data"]

[services.db]
image = "groonga/pgroonga:3.1.8-alpine-16-slim"
container_name = "firefish-db"
networks = ["firefish"]
volumes = ["db:/var/lib/postgresql/data"]

[services.db.healthcheck]
test = "pg_isready --user=\"firefish\" --dbname=\"firefish\""
interval = "5s"
timeout = "5s"
retries = 5

[networks.firefish]
internal = true

[networks.proxy]
external = true
