Skip to content

Commit

Permalink
🩺 Updated Healthchecks
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachid F committed Jun 1, 2024
1 parent 067f456 commit a657503
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ OAUTH_REDIRECT_BASE=http://localhost:3000
JWT_SECRET=secret_jwt
ENCRYPT_CRYPTO_SECRET_KEY="0123456789abcdef0123456789abcdef"
BACKEND_PORT=3000

BACKEND_HOSTNAME="0.0.0.0"
#Managed only
SENTRY_DSN=

Expand Down
2 changes: 2 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ services:
REDIS_HOST: ${REDIS_HOST}
REDIS_PASS: ${REDIS_PASS}
REDIS_PORT: ${REDIS_PORT}
BACKEND_HOSTNAME: ${BACKEND_HOSTNAME}
BACKEND_PORT: ${BACKEND_PORT}
ENCRYPT_CRYPTO_SECRET_KEY: ${ENCRYPT_CRYPTO_SECRET_KEY}
HUBSPOT_CRM_CLOUD_CLIENT_ID: ${HUBSPOT_CRM_CLOUD_CLIENT_ID}
HUBSPOT_CRM_CLOUD_CLIENT_SECRET: ${HUBSPOT_CRM_CLOUD_CLIENT_SECRET}
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ services:
REDIS_HOST: ${REDIS_HOST}
REDIS_PASS: ${REDIS_PASS}
REDIS_PORT: ${REDIS_PORT}
BACKEND_HOSTNAME: ${BACKEND_HOSTNAME}
BACKEND_PORT: ${BACKEND_PORT}
ENCRYPT_CRYPTO_SECRET_KEY: ${ENCRYPT_CRYPTO_SECRET_KEY}
HUBSPOT_CRM_CLOUD_CLIENT_ID: ${HUBSPOT_CRM_CLOUD_CLIENT_ID}
HUBSPOT_CRM_CLOUD_CLIENT_SECRET: ${HUBSPOT_CRM_CLOUD_CLIENT_SECRET}
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ services:
image: panoradotdev/backend-api:selfhosted
environment:
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:5432/${POSTGRES_DB}?ssl=false
PORT: ${BACKEND_PORT}
DISTRIBUTION: ${DISTRIBUTION}
JWT_SECRET: ${JWT_SECRET}
REDIS_HOST: ${REDIS_HOST}
REDIS_PASS: ${REDIS_PASS}
REDIS_PORT: ${REDIS_PORT}
BACKEND_HOSTNAME: ${BACKEND_HOSTNAME}
BACKEND_PORT: ${BACKEND_PORT}
ENCRYPT_CRYPTO_SECRET_KEY: ${ENCRYPT_CRYPTO_SECRET_KEY}
HUBSPOT_CRM_CLOUD_CLIENT_ID: ${HUBSPOT_CRM_CLOUD_CLIENT_ID}
HUBSPOT_CRM_CLOUD_CLIENT_SECRET: ${HUBSPOT_CRM_CLOUD_CLIENT_SECRET}
Expand Down Expand Up @@ -106,7 +107,6 @@ services:
MAILCHIMP_MARKETINGAUTOMATION_CLOUD_CLIENT_SECRET: ${MAILCHIMP_MARKETINGAUTOMATION_CLOUD_CLIENT_SECRET}
PODIUM_MARKETINGAUTOMATION_CLOUD_CLIENT_ID: ${PODIUM_MARKETINGAUTOMATION_CLOUD_CLIENT_ID}
PODIUM_MARKETINGAUTOMATION_CLOUD_CLIENT_SECRET: ${PODIUM_MARKETINGAUTOMATION_CLOUD_CLIENT_SECRET}

restart: unless-stopped
ports:
- 3000:3000
Expand Down
6 changes: 5 additions & 1 deletion packages/api/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ async function bootstrap() {
app.useGlobalInterceptors(new LoggerErrorInterceptor());
app.use(cookieParser());

await app.listen(3000);

// Passing a host is required by some PaaS providers such as flightcontrol
const port = process.env.BACKEND_PORT || 3000;
const host = process.env.BACKEND_HOSTNAME || '0.0.0.0';
await app.listen(port, host);
}
bootstrap();

0 comments on commit a657503

Please sign in to comment.