24 lines
591 B
YAML
24 lines
591 B
YAML
# docker-compose.yml
|
|
version: '3.8'
|
|
|
|
services:
|
|
# Service untuk aplikasi Node.js
|
|
app:
|
|
container_name: express-test
|
|
# Build image dari Dockerfile di direktori saat ini
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
# Port mapping: <port-host>:<port-container>
|
|
ports:
|
|
- "4000:4000"
|
|
# Variabel lingkungan yang dibutuhkan oleh aplikasi
|
|
environment:
|
|
- PORT=4000
|
|
- DB_HOST=database
|
|
- DB_PORT=5432
|
|
- DB_USER=postgres
|
|
- DB_PASSWORD=postgres_password
|
|
- DB_NAME=tododb
|
|
# Restart policy
|
|
restart: unless-stopped |