Skip to content

Commit 40e258e

Browse files
committed
Improve Dockerfile
1 parent 12accac commit 40e258e

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

.dockerignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.svelte-kit
2+
build
3+
node_modules
4+
package-lock.json
5+
pnpm-lock.yaml

Dockerfile

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1-
FROM node:18-alpine
1+
# Create build image
2+
FROM node:22-alpine AS build
23

34
WORKDIR /app
45

5-
COPY . .
6-
6+
COPY package.json .
77
RUN npm install
8+
9+
COPY . .
810
RUN npm run build
911

10-
CMD [ "node", "build" ]
12+
# Create runtime image
13+
FROM node:22-alpine
14+
15+
WORKDIR /app
16+
17+
COPY --from=build /app/build .
18+
19+
CMD [ "node", "." ]

0 commit comments

Comments
 (0)