Compare commits
1 Commits
rf/bundle
...
dev-docker
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5131ee8b89 |
86
docker-compose-dev.yml
Normal file
86
docker-compose-dev.yml
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
version: "3.7"
|
||||||
|
|
||||||
|
services:
|
||||||
|
db:
|
||||||
|
image: postgres:14
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- db_data:/var/lib/postgresql/data
|
||||||
|
expose:
|
||||||
|
- 5432
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
|
environment:
|
||||||
|
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||||||
|
POSTGRES_DB: windmill
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
|
windmill_server:
|
||||||
|
image: ghcr.io/windmill-labs/windmill:main
|
||||||
|
deploy:
|
||||||
|
replicas: 1
|
||||||
|
restart: unless-stopped
|
||||||
|
expose:
|
||||||
|
- 8000
|
||||||
|
ports:
|
||||||
|
- 8000:8000
|
||||||
|
environment:
|
||||||
|
- DATABASE_URL=postgres://postgres:${DB_PASSWORD}@db/windmill?sslmode=disable
|
||||||
|
- BASE_URL=http://${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
|
||||||
|
- DISABLE_SERVER=false
|
||||||
|
- METRICS_ADDR=false
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
# volumes:
|
||||||
|
# - ./oauth.json/:/usr/src/app/oauth.json
|
||||||
|
|
||||||
|
windmill_worker:
|
||||||
|
image: ghcr.io/windmill-labs/windmill:main
|
||||||
|
deploy:
|
||||||
|
replicas: 3
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
- DATABASE_URL=postgres://postgres:${DB_PASSWORD}@db/windmill?sslmode=disable
|
||||||
|
- BASE_URL=http://${WM_BASE_URL}
|
||||||
|
- BASE_INTERNAL_URL=http://windmill_server:8000
|
||||||
|
- RUST_LOG=info
|
||||||
|
- NUM_WORKERS=1
|
||||||
|
- DISABLE_SERVER=true
|
||||||
|
- KEEP_JOB_DIR=false
|
||||||
|
- DENO_PATH=/usr/bin/deno
|
||||||
|
- PYTHON_PATH=/usr/local/bin/python3
|
||||||
|
- METRICS_ADDR=false
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
# to mount the worker folder to debug,, KEEP_JOB_DIR=true and mount /tmp/windmill
|
||||||
|
volumes:
|
||||||
|
- worker_dependency_cache:/tmp/windmill/cache
|
||||||
|
|
||||||
|
lsp:
|
||||||
|
image: ghcr.io/windmill-labs/windmill-lsp:latest
|
||||||
|
restart: unless-stopped
|
||||||
|
expose:
|
||||||
|
- 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
|
||||||
|
worker_dependency_cache: null
|
||||||
@@ -17,7 +17,7 @@ In the root folder:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker build . -t windmill
|
docker build . -t windmill
|
||||||
docker compose up db windmill_server windmill_worker
|
docker compose -f docker-compose-dev.yml up db windmill_server windmill_worker
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. Backend is run by cargo
|
### 2. Backend is run by cargo
|
||||||
@@ -28,20 +28,23 @@ docker compose up db windmill_server windmill_worker
|
|||||||
- Install llvm
|
- Install llvm
|
||||||
|
|
||||||
**On OSX:**
|
**On OSX:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
brew install llvm caddy gsed
|
brew install llvm caddy gsed
|
||||||
|
|
||||||
# make LLVM tools available on PATH
|
# make LLVM tools available on PATH
|
||||||
echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc
|
echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc
|
||||||
|
|
||||||
# now, restart your shell. You should now have the `lld` binary on your PATH.
|
# now, restart your shell. You should now have the `lld` binary on your PATH.
|
||||||
```
|
```
|
||||||
|
|
||||||
- To test that you have Rust and Cargo installed run `cargo --version`
|
- To test that you have Rust and Cargo installed run `cargo --version`
|
||||||
|
|
||||||
- In your terminal, go to the backend directory and run `cargo build`
|
- In your terminal, go to the backend directory and run `cargo build`
|
||||||
- Run `cargo run`
|
- Run `cargo run`
|
||||||
|
|
||||||
**Known issue on M1 Mac while running `cargo build`**
|
**Known issue on M1 Mac while running `cargo build`**
|
||||||
|
|
||||||
- You may encounter `linking with cc failed` build time error.
|
- You may encounter `linking with cc failed` build time error.
|
||||||
- To solve this run:
|
- To solve this run:
|
||||||
```bash
|
```bash
|
||||||
@@ -49,7 +52,6 @@ docker compose up db windmill_server windmill_worker
|
|||||||
source ~/.zshrc
|
source ~/.zshrc
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
**Do a Frontend Build**
|
**Do a Frontend Build**
|
||||||
|
|
||||||
In order to run the backend, you need to have a frontend build inside `frontend/build/`.
|
In order to run the backend, you need to have a frontend build inside `frontend/build/`.
|
||||||
@@ -70,11 +72,14 @@ npm run build
|
|||||||
```
|
```
|
||||||
|
|
||||||
**Known issue while running `npm run build`**
|
**Known issue while running `npm run build`**
|
||||||
|
|
||||||
- You may encounter `FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory` error.
|
- You may encounter `FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory` error.
|
||||||
- To solve this run:
|
- To solve this run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
export NODE_OPTIONS=--max_old_space_size=8096
|
export NODE_OPTIONS=--max_old_space_size=8096
|
||||||
```
|
```
|
||||||
|
|
||||||
- run `npm run build` again
|
- run `npm run build` again
|
||||||
|
|
||||||
In the root folder:
|
In the root folder:
|
||||||
@@ -86,7 +91,7 @@ docker-compose up db
|
|||||||
In the backend folder:
|
In the backend folder:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
DATABASE_URL=postgres://postgres:changeme@127.0.0.1:5433/windmill?sslmode=disable cargo run
|
DATABASE_URL=postgres://postgres:changeme@127.0.0.1:5432/windmill?sslmode=disable cargo run
|
||||||
```
|
```
|
||||||
|
|
||||||
You can now access [http://127.0.0.1:8000](http://127.0.0.1:8000).
|
You can now access [http://127.0.0.1:8000](http://127.0.0.1:8000).
|
||||||
@@ -146,13 +151,13 @@ Recommended config for VS Code:
|
|||||||
|
|
||||||
- turn _format on save_ on
|
- turn _format on save_ on
|
||||||
|
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
The project is built with [SvelteKit](https://kit.svelte.dev/) and uses as output static files.
|
The project is built with [SvelteKit](https://kit.svelte.dev/) and uses as output static files.
|
||||||
There are others adapters for sveltekit, but we use the static adapter.
|
There are others adapters for sveltekit, but we use the static adapter.
|
||||||
|
|
||||||
To build the frontend as static assets, use:
|
To build the frontend as static assets, use:
|
||||||
|
|
||||||
```
|
```
|
||||||
npm run build
|
npm run build
|
||||||
```
|
```
|
||||||
@@ -160,10 +165,11 @@ npm run build
|
|||||||
The output is in the `build` folder.
|
The output is in the `build` folder.
|
||||||
|
|
||||||
The default build assume you serve every non static files as the 200.html file which is catchall. If you prefer a normal layout, you can use:
|
The default build assume you serve every non static files as the 200.html file which is catchall. If you prefer a normal layout, you can use:
|
||||||
|
|
||||||
```
|
```
|
||||||
NOTCATCHALL=true npm run build
|
NOTCATCHALL=true npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
which will generate an index.html and allow you to serve the frontend with any static server.
|
which will generate an index.html and allow you to serve the frontend with any static server.
|
||||||
|
|
||||||
Env variables used for build are set in .env file. See [https://vitejs.dev/guide/env-and-mode.html#env-files](https://vitejs.dev/guide/env-and-mode.html#env-files) for more details.
|
Env variables used for build are set in .env file. See [https://vitejs.dev/guide/env-and-mode.html#env-files](https://vitejs.dev/guide/env-and-mode.html#env-files) for more details.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user