Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3"

services:
app:
build:
Expand All @@ -9,27 +7,38 @@ services:
volumes:
- ..:/workspace:cached

# Overrides default command so things don't shut down after the process ends.
# Keep the development container running.
command: sleep infinity

# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
# Start supporting services before the app container.
depends_on:
db:
condition: service_healthy
redis:
condition: service_started

network_mode: service:db

db:
image: postgres:latest
image: postgres:17
restart: unless-stopped

volumes:
- postgres-data:/var/lib/postgresql/data

environment:
POSTGRES_DB: app
POSTGRES_USER: app_user
POSTGRES_PASSWORD: app_password

# Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
healthcheck:
test: ["CMD-SHELL", "pg_isready -U app_user -d app"]
interval: 5s
timeout: 5s
retries: 10

redis:
image: redis
image: redis:7-alpine
restart: unless-stopped

volumes:
Expand Down
Loading