Luis
PPrisma
•Created by Luis on 4/2/2025 in #help-and-questions
Automatically create SQLite database and run Prisma migrations in Docker for Next.js app
Hey! 👋
Sorry for the delayed response, and thank you so much for your detailed reply—it really helped me understand how to set things up correctly!
In the end, I opted for a similar solution, using a specific entrypoint file in the Dockerfile. Here's how I implemented it:
In the Dockerfile:
And here's the content of the
entrypoint.sh
file:
Two quick tips based on my experience:
- Carefully check the location of your entrypoint.sh
file.
- Always add #!/bin/sh
at the beginning of your entrypoint script because bash may not work correctly inside Alpine Docker images (so you need to use sh
).
Thanks again for your valuable help! 🙏😊5 replies