# Development stack: Postgres, the backend with live reload, and the Vite dev server. # # docker compose -f docker-compose.dev.yml up # # Then open http://localhost:5173. For laptops only: the password is fixed and # Postgres is published on 5432. docker-compose.yml is the deployment stack. services: db: image: postgres:16-alpine environment: POSTGRES_USER: inkwell POSTGRES_PASSWORD: inkwell POSTGRES_DB: inkwell volumes: - inkwell-dev-db:/var/lib/postgresql/data ports: - "5432:5432" api: image: python:3.12-slim working_dir: /app depends_on: - db environment: INKWELL_DATABASE_URL: postgresql+asyncpg://inkwell:inkwell@db:5432/inkwell PYTHONPATH: /app/src volumes: - ./pyproject.toml:/app/pyproject.toml - ./alembic.ini:/app/alembic.ini - ./alembic:/app/alembic - ./src:/app/src - inkwell-dev-data:/var/inkwell ports: - "5000:5000" # Install deps, wait for the DB, run migrations, then serve with live reload. command: > sh -c "pip install --quiet -e . && python -m inkwell.dbwait && alembic upgrade head && hypercorn 'inkwell.app:create_app()' --bind 0.0.0.0:5000 --reload" web: image: node:22-alpine working_dir: /app depends_on: - api environment: # Vite proxies /api to the backend service (see frontend/vite.config.ts). VITE_API_TARGET: http://api:5000 volumes: - ./frontend:/app - /app/node_modules ports: - "5173:5173" command: sh -c "npm install && npm run dev -- --host 0.0.0.0" volumes: inkwell-dev-db: inkwell-dev-data: