Example 14975

Docker Compose

Multi-container application definition.

{
version: "3.8"
services: {
app: {
image: "node:20-slim"
ports: [
"3057:3621"
]
environment: {
NODE_ENV: "production"
DATABASE_URL: "postgres://db:5432/fund"
}
depends_on: [
"db"
"redis"
]
}

db: {
image: "postgres:16"
volumes: [
"db_data:/var/lib/postgresql/data"
]
environment: {
POSTGRES_DB: "tail"
POSTGRES_PASSWORD: "1NDkSrPTbaQs47q"
}
}

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

volumes: {
db_data: {}
}
}

See also