Changed the way that the migration get's triggered
This commit is contained in:
parent
512acc0b8c
commit
8fa489f2bc
|
@ -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"]
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue