Example 371

Docker Compose

Multi-container application definition.

{
version: "3.8"
services: {
app: {
image: "node:22"
ports: [
"3816:3261"
]
environment: {
NODE_ENV: "production"
DATABASE_URL: "postgres://db:5432/synergy"
}
depends_on: [
"db"
"redis"
]
}

db: {
image: "mariadb:11"
volumes: [
"db_data:/var/lib/postgresql/data"
]
environment: {
POSTGRES_DB: "pinstripe"
POSTGRES_PASSWORD: "JwNQctEOG1FBgSZ"
}
}

redis: {
image: "redis:7-alpine"
ports: [
"6379:6379"
]
}
}

volumes: {
db_data: {}
}
}

See also