chore: fix build command

This commit is contained in:
Damillora 2022-07-24 23:37:50 +07:00
parent 29955b4faa
commit 649bf4e207
2 changed files with 10 additions and 20 deletions

View File

@ -1,25 +1,15 @@
FROM node:14 FROM node:16-alpine
# install dependencies # install dependencies
WORKDIR /app WORKDIR /app
RUN npm install -g pnpm RUN npm install -g pnpm
COPY package.json pnpm-lock.yaml ./ COPY . .
RUN pnpm install RUN pnpm install
RUN pnpm build
# Copy all local files into the image. FROM node:16-alpine
COPY . .
RUN yarn build
###
# Only copy over the Node pieces we need
# ~> Saves 35MB
###
FROM node:14-slim
WORKDIR /app WORKDIR /app
COPY --from=0 /app . COPY --from=0 /app/build /app
COPY . . COPY --from=0 /app/package.json /app
COPY --from=0 /app/node_modules /app/node_modules
EXPOSE 3000 EXPOSE 3000
CMD ["node", "./build"] CMD ["node","./index.js"]

View File

@ -3,8 +3,8 @@
"version": "0.0.1", "version": "0.0.1",
"scripts": { "scripts": {
"dev": "vite dev", "dev": "vite dev",
"build": "svelte-kit build", "build": "vite build",
"preview": "svelte-kit preview", "preview": "vite preview",
"lint": "prettier --check . && eslint --ignore-path .gitignore .", "lint": "prettier --check . && eslint --ignore-path .gitignore .",
"format": "prettier --write ." "format": "prettier --write ."
}, },