Files
WYGIWYH/docker-compose.dev.yml
T
Herculino Trotta a691da7523 chore(dev): run the dev stack in multiple git worktrees
Drop fixed container names so each worktree gets its own containers,
add docker/dev/worktree.sh to set up and tear down a worktree, and
document it under a new Development section in the README.
2026-11-08 02:48:59 -03:00

64 lines
1.7 KiB
YAML

volumes:
wygiwyh_dev_postgres_data: {}
wygiwyh_temp:
wygiwyh_attachments:
wygiwyh_node_modules:
services:
web:
build:
context: .
dockerfile: ./docker/dev/django/Dockerfile
image: wygiwyh_dev_server
volumes:
- ./app/:/usr/src/app/:z
- ./frontend/:/usr/src/frontend:z
- wygiwyh_temp:/usr/src/app/temp/
- wygiwyh_attachments:/usr/src/app/attachments/
ports:
- "${OUTBOUND_PORT:-8000}:${INTERNAL_PORT:-8000}"
env_file:
- .env
environment:
# The browser loads assets straight from vite, so Django must point at the published port
- DJANGO_VITE_DEV_SERVER_PORT=${WEBPACK_OUTBOUND_PORT:-5173}
depends_on:
- db
- vite
restart: unless-stopped
vite:
build:
context: .
dockerfile: ./docker/dev/vite/Dockerfile
image: wygiwyh_dev_node
volumes:
- ./frontend/:/usr/src/frontend
- ./app/:/usr/src/app/
# http://jdlm.info/articles/2016/03/06/lessons-building-node-app-docker.html
- wygiwyh_node_modules:/usr/src/frontend/node_modules
ports:
- '${WEBPACK_OUTBOUND_PORT:-5173}:${WEBPACK_OUTBOUND_PORT:-5173}'
environment:
- WATCHPACK_POLLING=true
- VITE_DEV_SERVER_PORT=${WEBPACK_OUTBOUND_PORT:-5173}
restart: unless-stopped
db:
image: postgres:15
volumes:
- wygiwyh_dev_postgres_data:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=${SQL_USER}
- POSTGRES_PASSWORD=${SQL_PASSWORD}
- POSTGRES_DB=${SQL_DATABASE}
ports:
- '${SQL_OUTBOUND_PORT:-${SQL_PORT:-5432}}:5432'
networks:
default:
# Keeps .env files that point SQL_HOST at the old fixed container name working
aliases:
- ${SQL_HOST:-db}
restart: unless-stopped