version: '3' services: redis: image: redis db: image: postgres:10 stop_signal: SIGINT # Fast shutdown. environment: POSTGRES_PASSWORD: password volumes: - ./misc/dbdata:/var/lib/postgresql/data web: # Docker hack to wait until Postgres is up, then run stuff. command: > bash -c "while ! nc -w 1 -z db 5432; do sleep 0.1; done; uv sync && ./manage.py migrate && exec ./manage.py runserver 0.0.0.0:8000" image: "imgz" build: . stop_signal: SIGINT # The devserver only stops on SIGINT. stdin_open: true tty: true volumes: - .:/code ports: - "8000:8000" depends_on: - db - redis environment: IN_DOCKER: 1 webserver: image: jumanjiman/caddy depends_on: - web ports: - "80:8000" command: -conf /code/misc/caddyfile.conf volumes: - .:/code