Reduce container size >.<
All checks were successful
Docker Deploy / build-and-push (push) Successful in 1m10s
All checks were successful
Docker Deploy / build-and-push (push) Successful in 1m10s
This commit is contained in:
parent
b3a00aa868
commit
7d50007d7e
1 changed files with 15 additions and 6 deletions
21
Dockerfile
21
Dockerfile
|
@ -1,16 +1,25 @@
|
||||||
FROM node:lts AS runtime
|
FROM node:lts-alpine AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy files
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
# Install pnpm
|
|
||||||
RUN npm i -g pnpm
|
RUN npm i -g pnpm
|
||||||
|
|
||||||
# Install dependencies and build
|
COPY package.json pnpm-lock.yaml ./
|
||||||
|
|
||||||
RUN pnpm install
|
RUN pnpm install
|
||||||
|
|
||||||
|
COPY . .
|
||||||
RUN pnpm run build
|
RUN pnpm run build
|
||||||
|
|
||||||
|
FROM node:lts-alpine AS runtime
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN npm i -g pnpm
|
||||||
|
|
||||||
|
COPY --from=builder /app/dist ./dist
|
||||||
|
COPY package.json pnpm-lock.yaml ./
|
||||||
|
|
||||||
|
RUN pnpm install --prod
|
||||||
|
|
||||||
ENV HOST=0.0.0.0
|
ENV HOST=0.0.0.0
|
||||||
ENV PORT=4321
|
ENV PORT=4321
|
||||||
EXPOSE 4321
|
EXPOSE 4321
|
||||||
|
|
Loading…
Add table
Reference in a new issue