From 13cc2cef816174b6d6b0f22e9e8f0859e784721e Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Sun, 5 May 2024 17:38:40 +0200 Subject: [PATCH] [#499]: ligretto-core use managed db (#500) --- .deploy/ligretto.deploy.yml | 28 ++++-------------------- .docker/Ligretto-core-backend_Dockerfile | 4 ++-- apps/ligretto-core-backend/package.json | 2 +- 3 files changed, 7 insertions(+), 27 deletions(-) diff --git a/.deploy/ligretto.deploy.yml b/.deploy/ligretto.deploy.yml index e3acd73b..eecae1eb 100644 --- a/.deploy/ligretto.deploy.yml +++ b/.deploy/ligretto.deploy.yml @@ -39,6 +39,8 @@ services: secrets: - source: LIGRETTO_CAS_KEY target: /ligretto-core-backend/key.pem + - source: LIGRETTO_PRODUCTION_ENV + target: /memebattle/.env.production.local environment: - LIGRETTO_CORE_CAS_PUBLIC_KEY_PATH=/ligretto-core-backend/key.pem - PORT=3333 @@ -47,12 +49,6 @@ services: - LIGRETTO_CORE_APP_KEY=BYnNsw-r-ndJTCy15Uqo8JAF4ONCA4X1 - CAS_PARTNER_ID=652468293877db2de8390fa3 - CAS_URL=https://cas.mems.fun/api - - LIGRETTO_CORE_DB_CONNECTION=pg - - LIGRETTO_CORE_PG_HOST=ligretto-core-pg - - LIGRETTO_CORE_PG_PORT=5432 - - LIGRETTO_CORE_PG_USER=ligretto-core-user - - LIGRETTO_CORE_PG_PASSWORD=ligretto_pg_password - - LIGRETTO_CORE_PG_DB_NAME=ligretto-core - LIGRETTO_CORE_APP_NAME=ligretto-core-backend deploy: labels: @@ -71,21 +67,6 @@ services: delay: 10s max_attempts: 3 - ligretto-core-pg: - image: postgres - environment: - POSTGRES_PASSWORD: ligretto_pg_password - POSTGRES_USER: ligretto-core-user - POSTGRES_DB: ligretto-core - networks: - - ligretto_net - volumes: - - ligretto-core-pg:/var/lib/postgresql/data - deploy: - placement: - constraints: - - node.role == manager - ligretto-bot-clj: image: ghcr.io/memebattle/ligretto-bot-clj:latest networks: @@ -117,9 +98,8 @@ services: secrets: LIGRETTO_CAS_KEY: external: true - -volumes: - ligretto-core-pg: + LIGRETTO_PRODUCTION_ENV: + external: true networks: traefik-public: diff --git a/.docker/Ligretto-core-backend_Dockerfile b/.docker/Ligretto-core-backend_Dockerfile index ba3c4b36..a5bd27cb 100644 --- a/.docker/Ligretto-core-backend_Dockerfile +++ b/.docker/Ligretto-core-backend_Dockerfile @@ -34,6 +34,6 @@ COPY --chown=node:node --from=build /memebattle/packages/ligretto-shared/package COPY --chown=node:node --from=build /memebattle/apps/ligretto-core-backend/package.json /memebattle/apps/ligretto-core-backend/package.json COPY --chown=node:node --from=build /memebattle/packages/ligretto-shared/build /memebattle/packages/ligretto-shared/build -COPY --chown=node:node --from=build /memebattle/apps/ligretto-core-backend/build /memebattle/apps/ligretto-core-backend/build +COPY --chown=node:node --from=build /memebattle/apps/ligretto-core-backend/build /memebattle/apps/ligretto-core-backend/ -ENTRYPOINT [ "node", "apps/ligretto-core-backend/build/server.js" ] +ENTRYPOINT [ "node", "apps/ligretto-core-backend/server.js" ] diff --git a/apps/ligretto-core-backend/package.json b/apps/ligretto-core-backend/package.json index d5cc0509..7bad5235 100644 --- a/apps/ligretto-core-backend/package.json +++ b/apps/ligretto-core-backend/package.json @@ -8,7 +8,7 @@ "start:dev": "node ace serve --watch", "postbuild": "yarn copy:yarn_lock && yarn copy:npm_rc", "migrate": "node ace migration:run --force", - "production-migrate": "node build/ace migration:run --force", + "production-migrate": "node ace migration:run --force", "ts-check": "tsc --noEmit" }, "devDependencies": {