Vegetable
Vegetable
WWindmill
Created by Vegetable on 8/30/2023 in #help
Self-hosted- Mounting volume into docker-compose
For anyone who searches for this after the fact. Below at the bottom, just add your mount here and the python interpreter can os.listdir('/mnt/data') just as it would.
windmill_worker:
image: ${WM_IMAGE}
pull_policy: always
deploy:
replicas: 3
restart: unless-stopped
environment:
- DATABASE_URL=${DATABASE_URL}
- BASE_URL=${WM_BASE_URL}
- RUST_LOG=info
- DISABLE_SERVER=true
- KEEP_JOB_DIR=false
- METRICS_ADDR=false
# To handle all tags, remove the env variable altogether. If you do so, you can remove the windmill_worker_native containers.
- WORKER_TAGS=deno,python3,go,bash,dependency,flow,hub,other,bun
# LICENSE_KEY is only needed for the enterprise edition
- LICENSE_KEY=${WM_LICENSE_KEY}
depends_on:
db:
condition: service_healthy
# to mount the worker folder to debug, KEEP_JOB_DIR=true and mount /tmp/windmill
volumes:
# mount the docker socket to allow to run docker containers from within the workers
- /var/run/docker.sock:/var/run/docker.sock
# See Oauth (https://docs.windmill.dev/docs/misc/setup_oauth)
- ./oauth.json:/usr/src/app/oauth.json
- worker_dependency_cache:/tmp/windmill/cache
- /mnt/data:/mnt/data ########### ADDED THIS HERE ######
windmill_worker:
image: ${WM_IMAGE}
pull_policy: always
deploy:
replicas: 3
restart: unless-stopped
environment:
- DATABASE_URL=${DATABASE_URL}
- BASE_URL=${WM_BASE_URL}
- RUST_LOG=info
- DISABLE_SERVER=true
- KEEP_JOB_DIR=false
- METRICS_ADDR=false
# To handle all tags, remove the env variable altogether. If you do so, you can remove the windmill_worker_native containers.
- WORKER_TAGS=deno,python3,go,bash,dependency,flow,hub,other,bun
# LICENSE_KEY is only needed for the enterprise edition
- LICENSE_KEY=${WM_LICENSE_KEY}
depends_on:
db:
condition: service_healthy
# to mount the worker folder to debug, KEEP_JOB_DIR=true and mount /tmp/windmill
volumes:
# mount the docker socket to allow to run docker containers from within the workers
- /var/run/docker.sock:/var/run/docker.sock
# See Oauth (https://docs.windmill.dev/docs/misc/setup_oauth)
- ./oauth.json:/usr/src/app/oauth.json
- worker_dependency_cache:/tmp/windmill/cache
- /mnt/data:/mnt/data ########### ADDED THIS HERE ######
2 replies