Skip to content

Commit

Permalink
Use shared database
Browse files Browse the repository at this point in the history
  • Loading branch information
mesudip committed Nov 8, 2024
1 parent a51b62e commit 6794eb3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
echo 'REGISTRY_BASE=registry.sireto.io/cardanoapi'
echo 'STACK_NAME=ccva'
echo 'DEPLOY_BASE_DOMAIN=ccv.cardanoapi.io'
echo 'DATABASE_PASSWORD=postgres'
echo 'DATABASE_PASSWORD=${{ secrets.TEST_DATABASE_PASSWORD }}'
echo 'CARDANO_NETWORK=preprod'
} > .env
Expand Down
1 change: 1 addition & 0 deletions deployment/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ STACK_NAME=ccva
DEPLOY_BASE_DOMAIN=ccv.cardanoapi.io
IMAGE_VERSION_TAG=v1
CARDANO_NETWORK=preprod
DATABASE_PASSWORD=XXXXX
GITHUB_TOKEN=XXXXX
30 changes: 13 additions & 17 deletions deployment/docker-compose-ccva.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,24 @@ services:
build:
context: ../
networks:
- default
- postgres
- frontend
environment:
- VIRTUAL_HOST=https://${DEPLOY_BASE_DOMAIN}
- DATABASE_URL=postgresql://postgres:postgres@db:5432/ccva
- NEXTAUTH_URL=https://${DEPLOY_BASE_DOMAIN}

db:
image: postgres:15
container_name: db
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=ccva
volumes:
- db:/var/lib/postgresql/data
networks:
- default

VIRTUAL_HOST: https://${DEPLOY_BASE_DOMAIN}
DATABASE_URL: postgresql://ccva:${DATABASE_PASSWORD}@postgres:5432/ccva_test
NEXTAUTH_URL: https://${DEPLOY_BASE_DOMAIN}
deploy:
placement:
constraints:
- node.labels.ccva==true
restart_policy:
delay: 15s
networks:
frontend:
name: frontend
external: true
postgres:
name: postgres
external: true
volumes:
db:

0 comments on commit 6794eb3

Please sign in to comment.