Skip to content

Commit 0c26333

Browse files
committed
feat: add Dockerfile for application containerization
- Introduced a multi-stage Dockerfile to build and run the application. - Configured the build stage to use Node.js with corepack and pnpm for dependency management. - Set up the runtime environment with necessary permissions and exposed ports for the application.
1 parent 55de1c3 commit 0c26333

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM node:lts as builder
2+
3+
WORKDIR /app
4+
5+
COPY . .
6+
7+
RUN corepack enable \
8+
&& pnpm install \
9+
&& NITRO_PRESET=node-server pnpm run build
10+
11+
FROM node:lts
12+
13+
COPY --from=builder /app/.output /app/.output
14+
COPY --from=builder /app/binaries /app/binaries
15+
16+
RUN chmod -R +x /app/binaries
17+
18+
WORKDIR /app
19+
20+
VOLUME ["/app/.data"]
21+
22+
EXPOSE 3000 1688
23+
24+
ENV HOST=0.0.0.0
25+
ENV PORT=3000
26+
27+
CMD ["node", ".output/server/index.mjs"]

0 commit comments

Comments
 (0)