fix: make docker startup complete successfully
This commit is contained in:
+1
-1
@@ -13,7 +13,6 @@ COOKIE_SECRET="CHANGE_ME_IN_LOCAL_ENV"
|
||||
APP_HOST="0.0.0.0"
|
||||
APP_PORT="4000"
|
||||
APP_ORIGIN="http://localhost:3000"
|
||||
PG_BOSS_SCHEMA="pgboss"
|
||||
SESSION_TTL_DAYS="30"
|
||||
GOOGLE_MAPS_SERVER_KEY="YOUR_SERVER_MAPS_KEY"
|
||||
|
||||
@@ -21,6 +20,7 @@ GOOGLE_MAPS_SERVER_KEY="YOUR_SERVER_MAPS_KEY"
|
||||
POSTGRES_DB="leads4less"
|
||||
POSTGRES_USER="postgres"
|
||||
POSTGRES_PASSWORD="CHANGE_ME_IN_LOCAL_ENV"
|
||||
PG_BOSS_SCHEMA="pgboss"
|
||||
|
||||
# Example Compose DATABASE_URL
|
||||
# DATABASE_URL="postgres://postgres:CHANGE_ME_IN_LOCAL_ENV@db:5432/leads4less"
|
||||
|
||||
@@ -16,6 +16,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
||||
- Aligned the Docker Compose and example environment settings so local and deployment configs use the same variable names and document URL-encoded database passwords when needed.
|
||||
- Simplified container deployment by adding a dedicated migration image and Compose startup ordering so the database becomes healthy, migrations run automatically, and the API, worker, and web services start afterward.
|
||||
|
||||
### Fixed
|
||||
- Fixed the Docker startup flow by passing required env validation into the migration container, bundling SQL migrations into the runtime image, and creating pg-boss queues before the worker starts consuming them.
|
||||
|
||||
## [2026-04-19]
|
||||
|
||||
### Added
|
||||
|
||||
@@ -23,6 +23,7 @@ COPY package*.json ./
|
||||
RUN npm ci --omit=dev
|
||||
|
||||
COPY --from=build /app/dist-server ./dist-server
|
||||
COPY db/migrations ./dist-server/db/migrations
|
||||
|
||||
FROM runtime-base AS api
|
||||
CMD ["npm", "run", "start:api"]
|
||||
|
||||
@@ -25,6 +25,7 @@ services:
|
||||
environment:
|
||||
NODE_ENV: ${NODE_ENV}
|
||||
DATABASE_URL: ${DATABASE_URL}
|
||||
COOKIE_SECRET: ${COOKIE_SECRET}
|
||||
PG_BOSS_SCHEMA: ${PG_BOSS_SCHEMA}
|
||||
restart: "no"
|
||||
|
||||
|
||||
@@ -2,6 +2,9 @@ import type { PgBoss } from 'pg-boss';
|
||||
import { RUN_DEEP_RESEARCH_BATCH_JOB, RUN_SEARCH_JOB } from './names.js';
|
||||
|
||||
export async function registerJobs(boss: PgBoss) {
|
||||
await boss.createQueue(RUN_SEARCH_JOB);
|
||||
await boss.createQueue(RUN_DEEP_RESEARCH_BATCH_JOB);
|
||||
|
||||
await boss.work(RUN_SEARCH_JOB, async ([job]) => {
|
||||
console.warn(`Job ${RUN_SEARCH_JOB} is queued but not implemented yet`, job?.id);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user