Fix: docker deployment

This commit is contained in:
Harshith Mullapudi 2025-08-06 11:00:49 +05:30
parent 4882f227d2
commit 4494dcafab
4 changed files with 12 additions and 7 deletions

View File

@ -1,7 +1,7 @@
VERSION=0.1.14
# Nest run in docker, change host to database container name
DB_HOST=localhost
DB_HOST=postgres
DB_PORT=5432
# POSTGRES
@ -10,7 +10,7 @@ POSTGRES_PASSWORD=docker
POSTGRES_DB=core
LOGIN_ORIGIN=http://localhost:3033
DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?schema=core
DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DB_HOST}:${DB_PORT}/${POSTGRES_DB}?schema=core
# This sets the URL used for direct connections to the database and should only be needed in limited circumstances
# See: https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#fields:~:text=the%20shadow%20database.-,directUrl,-No

View File

@ -29,11 +29,10 @@ services:
- TRIGGER_PROJECT_ID=${TRIGGER_PROJECT_ID}
- TRIGGER_SECRET_KEY=${TRIGGER_SECRET_KEY}
- TRIGGER_API_URL=${TRIGGER_API_URL}
- POSTGRES_DB=${POSTGRES_DB}
ports:
- "3033:3000"
depends_on:
init:
condition: service_started
postgres:
condition: service_healthy
redis:
@ -45,7 +44,7 @@ services:
postgres:
container_name: core-postgres
image: redplanethq/postgres:0.1.0
image: tegonhq/tegon-postgres:0.1.0-alpha
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
@ -57,7 +56,7 @@ services:
networks:
- core
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $POSTGRES_USER"]
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
@ -99,6 +98,7 @@ services:
networks:
core:
name: core-network
driver: bridge
volumes:

View File

@ -32,7 +32,7 @@ POSTGRES_USER=docker
POSTGRES_PASSWORD=docker
TRIGGER_DB=trigger
DB_HOST=host.docker.internal
DB_HOST=postgres
DB_PORT=5432
DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DB_HOST}:${DB_PORT}/${TRIGGER_DB}?schema=public&sslmode=disable

View File

@ -21,6 +21,7 @@ services:
- NODE_ENV=production
networks:
- webapp
- core-network
webapp:
container_name: trigger-webapp
@ -107,6 +108,7 @@ services:
logging: *logging-config
networks:
- webapp
- core-network
environment:
DATABASE_URL: ${ELECTRIC_DATABASE_URL:-postgresql://postgres:postgres@postgres:5432/main?schema=public&sslmode=disable}
ELECTRIC_INSECURE: true
@ -167,6 +169,7 @@ services:
- supervisor
- docker-proxy
- webapp
- core-network
volumes:
- shared:/home/node/shared
# Only needed for bootstrap
@ -241,3 +244,5 @@ networks:
name: supervisor
webapp:
name: webapp
core-network:
external: true