Merge pull request #1203 from anbraten/apply-migrations

feat: run migrations on start
This commit is contained in:
Mike Cao 2022-06-14 17:23:31 -07:00 committed by GitHub
commit 5899a8d45c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 38 additions and 197 deletions

View file

@ -32,10 +32,14 @@ ENV NEXT_TELEMETRY_DISABLED 1
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
RUN yarn global add prisma
# You only need to copy next.config.js if you are NOT using the default configuration
COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/public ./public
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/prisma/schema.prisma ./prisma/schema.prisma
COPY --from=builder /app/prisma/migrations ./prisma/migrations
# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
@ -48,4 +52,4 @@ EXPOSE 3000
ENV PORT 3000
CMD ["node", "server.js"]
CMD ["yarn", "production"]