Skip to content

Commit

Permalink
Improve Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
MineGame159 committed Sep 20, 2024
1 parent 12accac commit 40e258e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.svelte-kit
build
node_modules
package-lock.json
pnpm-lock.yaml
17 changes: 13 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
FROM node:18-alpine
# Create build image
FROM node:22-alpine AS build

WORKDIR /app

COPY . .

COPY package.json .
RUN npm install

COPY . .
RUN npm run build

CMD [ "node", "build" ]
# Create runtime image
FROM node:22-alpine

WORKDIR /app

COPY --from=build /app/build .

CMD [ "node", "." ]

0 comments on commit 40e258e

Please sign in to comment.