Simplificar Dockerfile - remover entrypoint customizado
This commit is contained in:
@@ -39,9 +39,11 @@ COPY --from=builder /app/.next/standalone ./
|
|||||||
COPY --from=builder /app/.next/static ./.next/static
|
COPY --from=builder /app/.next/static ./.next/static
|
||||||
COPY --from=builder /app/prisma ./prisma
|
COPY --from=builder /app/prisma ./prisma
|
||||||
COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
|
COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
|
||||||
COPY frontend/docker-entrypoint.sh ./docker-entrypoint.sh
|
COPY --from=builder /app/node_modules/@prisma ./node_modules/@prisma
|
||||||
|
COPY --from=builder /app/package*.json ./
|
||||||
|
|
||||||
RUN chmod +x ./docker-entrypoint.sh
|
# Install prisma CLI for migrations
|
||||||
|
RUN npm install -g prisma
|
||||||
|
|
||||||
USER nextjs
|
USER nextjs
|
||||||
|
|
||||||
@@ -50,5 +52,4 @@ EXPOSE 3000
|
|||||||
ENV PORT=3000
|
ENV PORT=3000
|
||||||
ENV HOSTNAME="0.0.0.0"
|
ENV HOSTNAME="0.0.0.0"
|
||||||
|
|
||||||
ENTRYPOINT ["./docker-entrypoint.sh"]
|
|
||||||
CMD ["node", "server.js"]
|
CMD ["node", "server.js"]
|
||||||
|
|||||||
8
init-db.sh
Normal file
8
init-db.sh
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Script para executar migrations manualmente
|
||||||
|
# Execute: docker exec <container_name> sh /app/init-db.sh
|
||||||
|
|
||||||
|
echo "🔄 Executando migrations do Prisma..."
|
||||||
|
npx prisma generate
|
||||||
|
npx prisma db push --skip-generate
|
||||||
|
echo "✅ Migrations executadas!"
|
||||||
Reference in New Issue
Block a user