From a72de74dfb9ff2578843dc49785a6b9ac0fca2fe Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sat, 8 Apr 2023 13:52:31 +0200 Subject: [PATCH] update self-host --- .env | 7 ++++++- Caddyfile | 4 ++-- docker-compose.yml | 15 +++++++-------- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.env b/.env index ac44c197cd..6752f0f11d 100644 --- a/.env +++ b/.env @@ -1,2 +1,7 @@ DB_PASSWORD=changeme -WM_BASE_URL=localhost + +# this is the url that your instance is publicly exposed to +WM_BASE_URL=http://localhost + +# this is the url that caddy will reverse proxy from. It might be different than WM_BASE_URL if you re using a second proxy/load balancer in front +CADDY_REVERSE_PROXY=http://localhost diff --git a/Caddyfile b/Caddyfile index 275e865102..e21ddd28e3 100644 --- a/Caddyfile +++ b/Caddyfile @@ -3,13 +3,13 @@ auto_https off } -http://{$BASE_URL} { +{$BASE_URL} { bind {$ADDRESS} reverse_proxy /ws/* http://lsp:3001 reverse_proxy /* http://windmill_server:8000 } -https://{$BASE_URL} { +{$BASE_URL} { bind {$ADDRESS} reverse_proxy /ws/* http://lsp:3001 } diff --git a/docker-compose.yml b/docker-compose.yml index 5dbb3ffe1d..87f80bf559 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,6 @@ -version: '3.7' +version: "3.7" services: - db: image: postgres:14 restart: unless-stopped @@ -13,7 +12,7 @@ services: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_DB: windmill healthcheck: - test: [ "CMD-SHELL", "pg_isready -U postgres" ] + test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 10s timeout: 5s retries: 5 @@ -27,7 +26,7 @@ services: - 8000 environment: - DATABASE_URL=postgres://postgres:${DB_PASSWORD}@db/windmill?sslmode=disable - - BASE_URL=http://${WM_BASE_URL} + - BASE_URL=${WM_BASE_URL} - RUST_LOG=info ## You can set the number of workers to > 0 and not need any separate worker service - NUM_WORKERS=0 @@ -37,8 +36,8 @@ services: db: condition: service_healthy # volumes: - # - ./oauth.json/:/usr/src/app/oauth.json - + # - ./oauth.json/:/usr/src/app/oauth.json + windmill_worker: image: ghcr.io/windmill-labs/windmill:main deploy: @@ -46,7 +45,7 @@ services: restart: unless-stopped environment: - DATABASE_URL=postgres://postgres:${DB_PASSWORD}@db/windmill?sslmode=disable - - BASE_URL=http://${WM_BASE_URL} + - BASE_URL=${WM_BASE_URL} - BASE_INTERNAL_URL=http://windmill_server:8000 - RUST_LOG=info - NUM_WORKERS=1 @@ -77,7 +76,7 @@ services: - 80:80 - 443:443 environment: - - BASE_URL=${WM_BASE_URL} + - BASE_URL=${CADDY_REVERSE_PROXY} volumes: db_data: null