Create docker file

This commit is contained in:
Tham Luu
2024-09-23 17:39:17 +08:00
parent 2842b3fc19
commit 735f2790a8
3 changed files with 25 additions and 7 deletions

View File

@ -1,14 +1,18 @@
FROM node:18.19.0-alpine3.19
FROM node:18.20.4-alpine3.20
WORKDIR /app/client
WORKDIR /app
RUN npm install -g pnpm
COPY package*.json .
RUN npm i
COPY pnpm-lock.yaml .
RUN pnpm install --prefer-offline=true --frozen-lockfile=true
RUN npm i -g serve
COPY . .
ENV NODE_ENV=production
ENV VITE_LOGIN_KEY=7fo24CMyIc
EXPOSE 5000
RUN pnpm build
CMD ["npm", "run", "dev"]
EXPOSE 3000
CMD [ "serve", "-s", "dist" ]