diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2b05e96..509fcf4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 diff --git a/deployment/.env.example b/deployment/.env.example index b7b4c04..c6ca21b 100644 --- a/deployment/.env.example +++ b/deployment/.env.example @@ -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 diff --git a/deployment/docker-compose-ccva.yml b/deployment/docker-compose-ccva.yml index cb18277..6f9c856 100644 --- a/deployment/docker-compose-ccva.yml +++ b/deployment/docker-compose-ccva.yml @@ -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: \ No newline at end of file