fix: run API as container primary process
This commit is contained in:
@@ -10,4 +10,4 @@ COPY constants.ts types.ts ./
|
|||||||
ENV APP_ENV=production
|
ENV APP_ENV=production
|
||||||
EXPOSE 3001
|
EXPOSE 3001
|
||||||
|
|
||||||
CMD ["sh", "-c", "npm run db:migrate && npm run db:bootstrap-admin && npm run start:api"]
|
CMD ["sh", "-c", "npm run db:migrate && npm run db:bootstrap-admin && exec ./node_modules/.bin/tsx server/src/index.ts"]
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ async function start() {
|
|||||||
|
|
||||||
for (const signal of ['SIGINT', 'SIGTERM']) {
|
for (const signal of ['SIGINT', 'SIGTERM']) {
|
||||||
process.once(signal, () => {
|
process.once(signal, () => {
|
||||||
|
app.log.info({ signal }, 'Shutdown signal received');
|
||||||
app.close()
|
app.close()
|
||||||
.then(closePool)
|
.then(closePool)
|
||||||
.finally(() => process.exit(0));
|
.finally(() => process.exit(0));
|
||||||
|
|||||||
Reference in New Issue
Block a user