From 7e3e6bbb427bc4f956f23b8fce11c4a833c3c190 Mon Sep 17 00:00:00 2001 From: Spencer Owen Date: Thu, 18 May 2023 22:53:27 -0600 Subject: [PATCH 1/3] Import login.json automatically --- docker-compose.yaml | 71 +++++++++++++++++++++++++++++++-------------- 1 file changed, 50 insertions(+), 21 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 2acbdf9a..cc5d7661 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,26 +1,55 @@ -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 + # - "$HOME/Library/Application Support/AnkerMake/AnkerMake_64bit_fp/login.json:/tmp/login.json" #TODO: Change to linux path + command: sh -c "cp /tmp/login.json /root/.config/ankerctl/login.json || true" + ankerctl_import: + image: ankerctl/ankerctl:latest + container_name: ankerctl_import + restart: "no" + volumes: + - ankerctl_vol:/root/.config/ankerctl + - "$HOME/Library/Application Support/AnkerMake/AnkerMake_64bit_fp/login.json:/tmp/login.json" + entrypoint: "/app/ankerctl.py" + command: ["config", "import", "/tmp/login.json"] + depends_on: + - ankerctl_seed_mac + - ankerctl_seed_linux + + 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 + 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 + driver: internal From d2d609a261622e4ce507ea6a6f82dbfd4e7ee845 Mon Sep 17 00:00:00 2001 From: Spencer Owen Date: Thu, 18 May 2023 23:10:49 -0600 Subject: [PATCH 2/3] Use latest image --- docker-compose.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index cc5d7661..0988c039 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -18,19 +18,22 @@ services: # - "$HOME/Library/Application Support/AnkerMake/AnkerMake_64bit_fp/login.json:/tmp/login.json" #TODO: Change to linux path 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 - - "$HOME/Library/Application Support/AnkerMake/AnkerMake_64bit_fp/login.json:/tmp/login.json" + # - "$HOME/Library/Application Support/AnkerMake/AnkerMake_64bit_fp/login.json:/tmp/login.json" entrypoint: "/app/ankerctl.py" - command: ["config", "import", "/tmp/login.json"] + 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 @@ -52,4 +55,4 @@ services: volumes: ankerctl_vol: - driver: internal + external: false From d3b01dda082d8b97ae732d5106702ba1542a4c9b Mon Sep 17 00:00:00 2001 From: Spencer Owen Date: Thu, 18 May 2023 23:20:14 -0600 Subject: [PATCH 3/3] Cleanup comments --- docker-compose.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 0988c039..a4df3385 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -15,7 +15,8 @@ services: restart: "no" volumes: - ankerctl_vol:/root/.config/ankerctl - # - "$HOME/Library/Application Support/AnkerMake/AnkerMake_64bit_fp/login.json:/tmp/login.json" #TODO: Change to linux path + # 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 @@ -25,7 +26,6 @@ services: build: . volumes: - ankerctl_vol:/root/.config/ankerctl - # - "$HOME/Library/Application Support/AnkerMake/AnkerMake_64bit_fp/login.json:/tmp/login.json" entrypoint: "/app/ankerctl.py" command: ["config", "import", "/root/.config/ankerctl/login.json"] depends_on: