Small refactor of scripts, Dockerfile, and docker-compose to support load balancing, and mutiple replicas. Various fixes related to playwright installation in container environment, static file handling, and etc.

This commit is contained in:
badblocks 2025-05-06 23:14:36 -07:00
parent 9b3b3d099f
commit 2dba19a77e
12 changed files with 109 additions and 127 deletions

View file

@ -1,15 +1,25 @@
services:
loba:
image: lucaslorentz/caddy-docker-proxy:2.9
ports:
- 8000:8000
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- caddy_data:/data
depends_on:
- web
web:
build:
context: .
dockerfile: Dockerfile
args:
ENV_FILE: .env.production
volumes:
- .:/code:z
ports:
- 8000:8000
volumes:
postgres_data:
ENV_FILE: .env.dev
deploy:
mode: replicated
replicas: 4
labels:
- "db_is_resettable_via_script"
caddy: ":8000"
caddy.reverse_proxy: "{{upstreams 8000}}"
volumes:
caddy_data: