Skip to content

Commit

Permalink
feat: add Dockerfile for application containerization
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
ikxin committed Jan 6, 2025
1 parent 55de1c3 commit 0c26333
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM node:lts as builder

Check warning on line 1 in Dockerfile

View workflow job for this annotation

GitHub Actions / docker

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

WORKDIR /app

COPY . .

RUN corepack enable \
&& pnpm install \
&& NITRO_PRESET=node-server pnpm run build

FROM node:lts

COPY --from=builder /app/.output /app/.output
COPY --from=builder /app/binaries /app/binaries

RUN chmod -R +x /app/binaries

WORKDIR /app

VOLUME ["/app/.data"]

EXPOSE 3000 1688

ENV HOST=0.0.0.0
ENV PORT=3000

CMD ["node", ".output/server/index.mjs"]

0 comments on commit 0c26333

Please sign in to comment.