services: gitops-watcher: build: . container_name: gitops-watcher restart: unless-stopped stop_grace_period: 2m environment: CHECK_INTERVAL: 300 STACKS_DIR: /opt/gitops CONFIG_PATH: /config/repos.yml STATE_PATH: /data/state.json LOCAL_DIR: /data/local REQUESTS_DIR: /data/requests GITEA_TOKEN: ${GITEA_TOKEN} GITHUB_TOKEN: ${GITHUB_TOKEN} volumes: - /var/run/docker.sock:/var/run/docker.sock # the watcher now WRITES repos.yml (add / stop / start / remove), so no :ro. # mount the folder, not the file: os.replace() can't swap a single-file bind mount - ./config:/config - ./data:/data - /opt/gitops:/opt/gitops gitops-web: build: . container_name: gitops-web restart: unless-stopped command: ["gunicorn", "--workers", "1", "--threads", "4", "--bind", "0.0.0.0:5000", "--chdir", "/app/web", "app:app"] ports: - "8088:5000" # LAN only until there's a login in front (NPM access list) environment: CHECK_INTERVAL: 300 STACKS_DIR: /opt/gitops CONFIG_PATH: /config/repos.yml STATE_PATH: /data/state.json LOCAL_DIR: /data/local REQUESTS_DIR: /data/requests TOKEN_ENVS: GITEA_TOKEN,GITHUB_TOKEN # names only, for the add-repo dropdown SECRET_KEY: ${WEB_SECRET_KEY} volumes: # NO docker socket: the website can't run containers, only ask the watcher - ./config:/config:ro - ./data:/data:ro # can read state.json... - ./data/local:/data/local # ...but only write local files - ./data/requests:/data/requests # ...and requests - /opt/gitops:/opt/gitops:ro # read the clones to show repo files