feat: add production deployment config
- Add docker-compose.prod.yml and Caddyfile for Caddy reverse proxy - Add production stages to frontend Dockerfile (nginx for static files) - Fix monorepo package exports for production builds (dist/src paths) - Add CORS_ORIGIN env var for cross-origin config - Add Better Auth baseURL, cookie domain, and trusted origins from env - Use VITE_API_URL for API calls in auth-client and play route - Add credentials: include for cross-origin fetch requests - Remove unused users table from schema
This commit is contained in:
parent
3f7bc4111e
commit
bc38137a12
20 changed files with 421515 additions and 34 deletions
91
docker-compose.prod.yml
Normal file
91
docker-compose.prod.yml
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
services:
|
||||
caddy:
|
||||
container_name: lila-caddy
|
||||
image: caddy:2-alpine
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- ./Caddyfile:/etc/caddy/Caddyfile
|
||||
- caddy_data:/data
|
||||
- caddy_config:/config
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
api:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- lila-network
|
||||
|
||||
api:
|
||||
container_name: lila-api
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./apps/api/Dockerfile
|
||||
target: runner
|
||||
env_file:
|
||||
- .env
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test:
|
||||
["CMD-SHELL", "wget -qO- http://localhost:3000/api/health || exit 1"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 5
|
||||
depends_on:
|
||||
database:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- lila-network
|
||||
|
||||
web:
|
||||
container_name: lila-web
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./apps/web/Dockerfile
|
||||
target: production
|
||||
args:
|
||||
VITE_API_URL: https://api.lilastudy.com
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- lila-network
|
||||
|
||||
database:
|
||||
container_name: lila-database
|
||||
image: postgres:18.3-alpine3.23
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- PGDATA=/var/lib/postgresql/data
|
||||
volumes:
|
||||
- lila-db:/var/lib/postgresql/data
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- lila-network
|
||||
|
||||
forgejo:
|
||||
container_name: lila-forgejo
|
||||
image: codeberg.org/forgejo/forgejo:11
|
||||
volumes:
|
||||
- forgejo-data:/data
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
ports:
|
||||
- "2222:22"
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- lila-network
|
||||
|
||||
networks:
|
||||
lila-network:
|
||||
|
||||
volumes:
|
||||
lila-db:
|
||||
caddy_data:
|
||||
caddy_config:
|
||||
forgejo-data:
|
||||
Loading…
Add table
Add a link
Reference in a new issue