Skip to content

Commit

Permalink
Merge pull request yuezk#24 from krw901/pr
Browse files Browse the repository at this point in the history
  • Loading branch information
yuezk authored Mar 9, 2023
2 parents 28127af + a9ff30c commit fe3bc4e
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM node:18-slim

WORKDIR /app

COPY package.json ./
COPY pnpm-lock.yaml ./
RUN corepack enable --install-directory=/usr/bin \
&& corepack prepare --activate pnpm@latest
RUN pnpm install --frozen-lockfile
COPY . .
RUN pnpm run build
RUN rm -rf node_modules
RUN pnpm install --frozen-lockfile --prod

# runtime image
FROM node:18-alpine

ENV TZ="Asia/Shanghai"

WORKDIR /app
COPY package.json .
COPY public /app/public
COPY --from=0 /app/node_modules /app/node_modules
COPY --from=0 /app/dist /app/dist

EXPOSE 3000

CMD ["npm", "run", "start:prod"]

0 comments on commit fe3bc4e

Please sign in to comment.