Skip to content

Commit af49e26

Browse files
committed
feat: add Dockerfile
1 parent 7ae819a commit af49e26

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

.dockerignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
node_modules
2+
dist
3+
4+
# nuxt
5+
.nuxt
6+
.output
7+
8+
# ide
9+
.vscode
10+
.idea
11+
12+
# env
13+
.env
14+
.git
15+
16+
# chore
17+
.DS_Store

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM node:lts-alpine AS build-stage
2+
3+
WORKDIR /app
4+
RUN corepack enable
5+
6+
COPY package.json pnpm-lock.yaml ./
7+
RUN --mount=type=cache,id=pnpm-store,target=/root/.pnpm-store \
8+
pnpm install --frozen-lockfile
9+
10+
COPY . .
11+
RUN pnpm build
12+
13+
# SSR
14+
FROM node:lts-alpine AS production-stage
15+
16+
WORKDIR /app
17+
18+
COPY --from=build-stage /app/.output ./.output
19+
20+
EXPOSE 3000
21+
22+
CMD ["node", ".output/server/index.mjs"]

0 commit comments

Comments
 (0)