chore: add postgres integration

This commit is contained in:
Saleel
2023-01-13 19:27:15 +05:30
parent 3d00f394f2
commit 3f572ffe2b
5 changed files with 233 additions and 47 deletions

View File

@@ -1,52 +1,86 @@
version: "3.9"
services:
api:
container_name: api
build:
context: ./
dockerfile: ./apps/api/Dockerfile
image: ${DOMAIN}-api:latest
restart: unless-stopped
env_file:
- .env
environment:
- NODE_ENV=production
- DB_NAME="/home/node/api/zk-groups.db"
volumes:
- sqlite:/home/node/api/zk-groups.db
ports:
- "3333:3333"
networks:
- zk-groups
postgres:
container_name: postgres
image: postgres
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: helloworld
POSTGRES_DB: zk-groups
PGDATA: /data/postgres
volumes:
- postgres:/data/postgres
- ./database/seed.sql:/docker-entrypoint-initdb.d/seed.sql
ports:
- "5432:5432"
restart: unless-stopped
command: postgres -c listen_addresses='*'
networks:
- zk-groups
client:
container_name: client
build:
context: ./
dockerfile: ./apps/client/Dockerfile
image: ${DOMAIN}-client:latest
restart: unless-stopped
environment:
- NODE_ENV=production
ports:
- "3002:80"
networks:
- zk-groups
api:
container_name: api
build:
context: ./
dockerfile: ./apps/api/Dockerfile
image: ${DOMAIN}-api:latest
restart: unless-stopped
environment:
- NODE_ENV=production
- DB_TYPE=postgres
- DB_URL=postgres://root:helloworld@postgres:5432/zk-groups
- JWT_SECRET_KEY=zk_groups_jwt_secret
- SESSION_SECRET=keyboard cat
- GITHUB_CLIENT_ID=sample
- GITHUB_CLIENT_SECRET=sample
- TWITTER_CONSUMER_KEY=sample
- TWITTER_CONSUMER_SECRET=sample
- REDDIT_CLIENT_ID=sample
- REDDIT_CLIENT_SECRET=sample
- BACKEND_PRIVATE_KEY=
- INFURA_API_KEY=
- COINMARKETCAP_API_KEY=
- ETHERSCAN_API_KEY=
- ZKGROUPS_GOERLI_ADDRESS=
ports:
- "3000:3333"
networks:
- zk-groups
depends_on:
- postgres
dashboard:
container_name: dashboard
build:
context: ./
dockerfile: ./apps/dashboard/Dockerfile
image: ${DOMAIN}-dashboard:latest
restart: unless-stopped
environment:
- NODE_ENV=production
ports:
- "3001:80"
networks:
- zk-groups
client:
container_name: client
build:
context: ./
dockerfile: ./apps/client/Dockerfile
image: ${DOMAIN}-client:latest
restart: unless-stopped
environment:
- NODE_ENV=production
ports:
- "3002:80"
networks:
- zk-groups
depends_on:
- api
dashboard:
container_name: dashboard
build:
context: ./
dockerfile: ./apps/dashboard/Dockerfile
image: ${DOMAIN}-dashboard:latest
restart: unless-stopped
environment:
- NODE_ENV=production
ports:
- "3001:80"
networks:
- zk-groups
depends_on:
- api
networks:
zk-groups:
@@ -54,4 +88,4 @@ networks:
driver: bridge
volumes:
sqlite:
postgres: