From b1e2c8d30b24e7bc9a1802bff9894247e033bc5c Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Sun, 19 May 2024 12:35:18 -0300 Subject: [PATCH 1/4] Publish payload dev container also --- .drone.yml | 15 ++++++++++++++- docker-compose.yml | 2 +- package.json | 4 ++-- payload/Dockerfile | 1 - 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index 289570a..57d35c1 100644 --- a/.drone.yml +++ b/.drone.yml @@ -14,7 +14,20 @@ steps: registry: git.autonomic.zone context: astro dockerfile: astro/Dockerfile - - name: publish payload container + - name: publish payload dev container + image: plugins/docker + settings: + username: 3wordchant + password: + from_secret: git_autonomic_zone_token_3wc + # NOTE: edit this if you want your image called something else + repo: git.autonomic.zone/autonomic-cooperative/astro-payload-test-payload-dev + auto_tag: true + registry: git.autonomic.zone + context: payload + dockerfile: payload/Dockerfile + target: dev + - name: publish payload prod container image: plugins/docker settings: username: 3wordchant diff --git a/docker-compose.yml b/docker-compose.yml index c14a422..89a56a2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,7 +19,7 @@ services: - payload payload: - image: git.autonomic.zone/autonomic-cooperative/astro-payload-test-payload:latest + image: git.autonomic.zone/autonomic-cooperative/astro-payload-test-payload-dev:latest container_name: ${NAME}-payload restart: unless-stopped build: diff --git a/package.json b/package.json index c92cfd1..739ca0f 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "license": "AGPL-3.0-or-later", "version": "1.2", "scripts": { - "dev": "docker compose up", + "dev": "docker compose up --build", "stop": "docker compose down", - "dev:build": "docker compose up --build" + "dev:nobuild": "docker compose up" } } diff --git a/payload/Dockerfile b/payload/Dockerfile index fd29dfe..27fd6ab 100644 --- a/payload/Dockerfile +++ b/payload/Dockerfile @@ -9,7 +9,6 @@ ENV NODE_ENV=development EXPOSE 3001 CMD ["yarn","dev"] - FROM base AS build ENV NODE_ENV=production WORKDIR /build From 5d84e7b38dbf892d4e80c96cfddbeb0bfde9414a Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Sun, 19 May 2024 12:37:14 -0300 Subject: [PATCH 2/4] Fix Drone config --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 57d35c1..2558000 100644 --- a/.drone.yml +++ b/.drone.yml @@ -59,7 +59,7 @@ steps: DRONE_URL: "https://drone.autonomic.zone" PAYLOAD_URL: "https://admin.paystro.swarm-demo.autonomic.zone" depends_on: - - publish payload container + - publish payload prod container trigger: branch: - main From a87bff676b2f01bf915d6135cc9431976a89f8df Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Sun, 19 May 2024 12:55:40 -0300 Subject: [PATCH 3/4] Fix Payload local instance Fixes autonomic-cooperative/astro-payload-template#23 --- docker-compose.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 89a56a2..fd6aad0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -31,14 +31,10 @@ services: PAYLOAD_URL: "http://localhost:${PAYLOAD_PORT}" PAYLOAD_PORT: ${PAYLOAD_PORT} PAYLOAD_SECRET: ${PAYLOAD_SECRET} - MONGODB_USER: - MONGODB_HOST: mongo - MONGODB_PASSWORD: - MONGODB_PORT: 27017 + MONGODB_URI: "mongodb://$MONGODB_USER:$MONGODB_PASSWORD@mongo:27017" volumes: - ./payload/src:/base/src - - ./astro/src/types.ts:/types.ts - volumes: + # - ./astro/src/types.ts:/types.ts - payload_media:/prod/dist/media ports: - ${PAYLOAD_PORT}:${PAYLOAD_PORT} From d30cd24f548c2d26b711101aa7eb4a15f2fbba7a Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Sun, 19 May 2024 13:00:59 -0300 Subject: [PATCH 4/4] Fix media volume path Ref autonomic-cooperative/astro-payload-template#22 --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index fd6aad0..0a5ab95 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,7 +35,7 @@ services: volumes: - ./payload/src:/base/src # - ./astro/src/types.ts:/types.ts - - payload_media:/prod/dist/media + - payload_media:/base/src/media ports: - ${PAYLOAD_PORT}:${PAYLOAD_PORT} networks: