Skip to content

How to start Prisma with distroless/nodejs22-debian12 image?Β #1782

@siddjellali

Description

@siddjellali

Hi team,

I'm currently building a Docker image using gcr.io/distroless/nodejs22-debian12:nonroot as the base for the production stage. Here's the relevant part of the Dockerfile:

FROM gcr.io/distroless/nodejs22-debian12:nonroot AS production

WORKDIR /app

COPY --from=build /app/dist ./dist
COPY --from=build /app/.env .env
COPY --from=build /app/node_modules ./node_modules

CMD ["dist/src/main", ";prisma migrate deploy; prisma db seed"]

I'm trying to understand:
Is it possible to run Prisma commands (e.g., prisma migrate deploy, prisma db seed) in a distroless image?
If so, how should I properly structure the CMD or ENTRYPOINT to support this?
Are there any best practices or recommendations to achieve this cleanly?

Any guidance or examples would be much appreciated!
Thanks in advance πŸ™

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions