diff --git a/.env b/.env index 75cc45b1c1..38e8bf85f1 100644 --- a/.env +++ b/.env @@ -1 +1,2 @@ DB_PASSWORD=changeme +WM_BASE_URL=windmill.localhost diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 0000000000..6ea75450cd --- /dev/null +++ b/Caddyfile @@ -0,0 +1,5 @@ +{$BASE_URL} { + bind {$ADDRESS} + reverse_proxy /ws/* http://lsp:3001 + reverse_proxy /* http://windmill:8000 +} diff --git a/docker-compose.yml b/docker-compose.yml index 1419208792..300f147af3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,10 +4,9 @@ services: db: image: postgres:14 - restart: always + restart: unless-stopped volumes: - db_data:/var/lib/postgresql/data - # - ./init-db.sql:/docker-entrypoint-initdb.d/create_tables.sql ports: - 5432:5432 environment: @@ -23,10 +22,10 @@ services: privileged: true restart: unless-stopped ports: - - 80:8000 + - 8000:8000 environment: - DATABASE_URL=postgres://postgres:${DB_PASSWORD}@db/windmill?sslmode=disable - - BASE_URL=http://localhost + - BASE_URL=http://${WM_BASE_URL}} - BASE_INTERNAL_URL=http://localhost:8000 - RUST_LOG=info - NUM_WORKERS=3 @@ -35,10 +34,24 @@ services: - DENO_PATH=/usr/bin/deno - PYTHON_PATH=/usr/local/bin/python3 - NSJAIL_PATH=nsjail - depends_on: db: condition: service_healthy -volumes: + lsp: + image: ghcr.io/windmill-labs/windmill-lsp:latest + restart: unless-stopped + ports: + - 3001:3001 + caddy: + image: caddy:2.5.2-alpine + restart: unless-stopped + volumes: + - ./Caddyfile:/etc/caddy/Caddyfile + ports: + - 80:80 + - 443:443 + environment: + - BASE_URL=${WM_BASE_URL} +volumes: db_data: null