Skip to content

Commit c733546

Browse files
committed
fix: some issues with the Dockerfile
1 parent 9bdce53 commit c733546

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ RUN cd /temp/prod && bun install --frozen-lockfile --production
1717
FROM base AS builder
1818
COPY --from=install /temp/dev/node_modules node_modules
1919
COPY . .
20-
RUN apt-get update && apt-get install -y openssl
2120
RUN bunx prisma generate
2221
ENV NODE_ENV=production
2322
RUN bun run build
2423

2524
FROM base AS runner
2625
WORKDIR /app
2726
ENV NODE_ENV=production
27+
RUN apt-get update && apt-get install -y openssl
2828
RUN addgroup --system --gid 1001 nodejs
2929
RUN adduser --system --uid 1001 nextjs
3030

@@ -35,13 +35,13 @@ COPY --from=builder /usr/src/app/prisma ./prisma
3535
COPY --from=builder /usr/src/app/node_modules/.prisma ./node_modules/.prisma
3636
COPY --from=builder /usr/src/app/node_modules/@prisma ./node_modules/@prisma
3737

38-
COPY --chown=nextjs:nodejs <<EOF /app/start.sh
39-
#!/bin/sh
40-
echo "Applying database migrations..."
41-
bunx prisma migrate deploy
42-
echo "Starting the application..."
43-
exec bun server.js
44-
EOF
38+
RUN echo '#!/bin/sh' > /app/start.sh && \
39+
echo 'echo "Applying database migrations..."' >> /app/start.sh && \
40+
echo 'bunx prisma migrate deploy' >> /app/start.sh && \
41+
echo 'echo "Starting the application..."' >> /app/start.sh && \
42+
echo 'exec bun server.js' >> /app/start.sh && \
43+
chmod +x /app/start.sh && \
44+
chown nextjs:nodejs /app/start.sh
4545

4646
RUN chmod +x /app/start.sh
4747

0 commit comments

Comments
 (0)