generated from autoblog/Seo
Add optimized Dockerfile for deployment
This commit is contained in:
parent
cc33e356e6
commit
8b44c1668e
1 changed files with 21 additions and 0 deletions
21
Template-01/Dockerfile
Normal file
21
Template-01/Dockerfile
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
FROM node:22-alpine AS builder
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN npm install --legacy-peer-deps
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
FROM node:22-alpine
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN npm install -g serve
|
||||||
|
|
||||||
|
COPY --from=builder /app/dist ./dist
|
||||||
|
|
||||||
|
EXPOSE 4321
|
||||||
|
|
||||||
|
CMD ["serve", "-s", "dist", "-l", "4321"]
|
||||||
Loading…
Reference in a new issue