diff --git a/docker-compose.yaml b/docker-compose.yaml index 2acbdf9a..a4df3385 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,26 +1,58 @@ -version: '3.9.1' +version: "3.9.1" -# You must manually run `ankerctl config import` atleast once -# docker run \ -# -v ankerctl_vol:/root/.config/ankerctl \ -# -v "$HOME/Library/Application Support/AnkerMake/AnkerMake_64bit_fp/login.json:/tmp/login.json" \ -# ankerctl config import /tmp/login.json services: - ankerctl: - image: ankerctl/ankerctl:latest - container_name: ankerctl - restart: unless-stopped - build: . - environment: - - FLASK_PORT=4470 - - FLASK_HOST=0.0.0.0 - volumes: - - ankerctl_vol:/root/.config/ankerctl - ports: - - 127.0.0.1:4470:4470 - entrypoint: "/app/ankerctl.py" - command: ["webserver", "run"] + ankerctl_seed_mac: + image: busybox + container_name: ankerctl_seed_mac + restart: "no" + volumes: + - ankerctl_vol:/root/.config/ankerctl + - "$HOME/Library/Application Support/AnkerMake/AnkerMake_64bit_fp/login.json:/tmp/login.json" + command: sh -c "cp /tmp/login.json /root/.config/ankerctl/login.json || true" + ankerctl_seed_linux: + image: busybox + container_name: ankerctl_seed_linux + restart: "no" + volumes: + - ankerctl_vol:/root/.config/ankerctl + # TODO: verify this is the correct linux path + - "$HOME/AnkerMake/AnkerMake_64bit_fp/login.json:/tmp/login.json" + command: sh -c "cp /tmp/login.json /root/.config/ankerctl/login.json || true" + ankerctl_import: + # image: ghcr.io/ankermgmt/ankermake-m5-protocol:latest + image: ankerctl/ankerctl:latest + container_name: ankerctl_import + restart: "no" + build: . + volumes: + - ankerctl_vol:/root/.config/ankerctl + entrypoint: "/app/ankerctl.py" + command: ["config", "import", "/root/.config/ankerctl/login.json"] + depends_on: + - ankerctl_seed_mac + - ankerctl_seed_linux + + ankerctl: + # image: ghcr.io/ankermgmt/ankermake-m5-protocol:latest + image: ankerctl/ankerctl:latest + container_name: ankerctl + restart: unless-stopped + build: . + environment: + - FLASK_PORT=4470 + - FLASK_HOST=0.0.0.0 + volumes: + - ankerctl_vol:/root/.config/ankerctl + ports: + - 127.0.0.1:4470:4470 + working_dir: /app + entrypoint: "/app/ankerctl.py" + command: ["webserver", "run"] + depends_on: + - ankerctl_seed_mac + - ankerctl_seed_linux + - ankerctl_import volumes: ankerctl_vol: - external: true + external: false