Skip to content

Commit

Permalink
[#499]: ligretto-core use managed db (#500)
Browse files Browse the repository at this point in the history
  • Loading branch information
Themezv authored May 5, 2024
1 parent 213423f commit 13cc2ce
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 27 deletions.
28 changes: 4 additions & 24 deletions .deploy/ligretto.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -117,9 +98,8 @@ services:
secrets:
LIGRETTO_CAS_KEY:
external: true

volumes:
ligretto-core-pg:
LIGRETTO_PRODUCTION_ENV:
external: true

networks:
traefik-public:
Expand Down
4 changes: 2 additions & 2 deletions .docker/Ligretto-core-backend_Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
2 changes: 1 addition & 1 deletion apps/ligretto-core-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 13cc2ce

Please sign in to comment.