Skip to content

Commit 11dead4

Browse files
committed
chore: enhance Dockerfile by copying server application and refining startup script
1 parent 156ea8a commit 11dead4

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Dockerfile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,19 @@ RUN bunx prisma generate
3232
FROM base AS release
3333
WORKDIR /usr/src/app
3434

35-
# Copy node_modules from build stage (includes all dependencies + Prisma)
36-
COPY --from=build /usr/src/app/node_modules ./node_modules
35+
# Copy root package.json and workspace node_modules
3736
COPY --from=build /usr/src/app/package.json ./package.json
37+
COPY --from=build /usr/src/app/node_modules ./node_modules
38+
39+
# Copy the entire server application (includes prisma/generated/client)
40+
COPY --from=build /usr/src/app/apps/server ./apps/server
3841

39-
# Copy the server application
42+
# Set working directory to server
4043
WORKDIR /usr/src/app/apps/server
41-
COPY --from=build /usr/src/app/apps/server .
4244

4345
# Create startup script with explicit working directory
44-
RUN echo '#!/bin/sh\ncd /usr/src/app/apps/server\nbunx prisma migrate deploy\nbun run start' > /usr/src/app/apps/server/start.sh && \
45-
chmod +x /usr/src/app/apps/server/start.sh
46+
RUN echo '#!/bin/sh\ncd /usr/src/app/apps/server\nbunx prisma migrate deploy\nbun run start' > start.sh && \
47+
chmod +x start.sh
4648

4749
USER bun
4850
EXPOSE 9999/tcp

0 commit comments

Comments
 (0)