Changed the way that the migration get's triggered

This commit is contained in:
Nicolai Ort 2021-08-14 13:09:25 +02:00
parent 512acc0b8c
commit 8fa489f2bc
Signed by: niggl
GPG Key ID: 13AFA55AF62F269F
2 changed files with 2 additions and 8 deletions

View File

@ -6,6 +6,7 @@ RUN yarn --production --frozen-lockfile
COPY migrations ./migrations
COPY src/server.js ./
COPY knexfile.js ./
RUN mkdir db
#
# FROM astefanutti/scratch-node:16.0.0
FROM node:16.6.2-alpine3.14
@ -13,4 +14,4 @@ WORKDIR /app
COPY --from=0 /app /app
ENV NODE_ENV production
EXPOSE 3000
ENTRYPOINT ["node", "./server.js"]
ENTRYPOINT ["/bin/sh", "-c", "yarn migrate && node ./server.js"]

View File

@ -315,13 +315,6 @@ async function validate(username, password, req, reply) {
// Run the server!
const start = async () => {
try {
await knex.migrate.latest()
} catch (err) {
fastify.log.error(err)
process.exit(1)
}
try {
await fastify.listen(3000, '0.0.0.0')
} catch (err) {