Skip to content
This repository has been archived by the owner on Jan 28, 2024. It is now read-only.

Commit

Permalink
fix: stop npm from swallowing exit signals; run migrations on launch
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs committed Apr 5, 2022
1 parent ce6d190 commit d4169fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ services:
ports:
- "127.0.0.1:${SERVICE_PORT:-8204}:${SERVICE_PORT:-8204}"
restart: "${DOCKER_RESTART_POLICY:-unless-stopped}"
command: ["npm", "run", "start:migrate"]

volumes:
ydh-community-contacts-api-db-data:
Expand Down
2 changes: 2 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const Fastify = require("fastify");
const startServer = require("./server");
const getConfig = require("./config");
const migrate = require("./migrate");

/**
* @author Frazer Smith
Expand All @@ -14,6 +15,7 @@ const main = async () => {
});

const config = await getConfig();
await migrate();

const server = Fastify(config.fastifyInit);
server.register(startServer, config);
Expand Down

0 comments on commit d4169fa

Please sign in to comment.