Skip to content

Commit

Permalink
make: Docker image optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
aeri committed Jul 26, 2024
1 parent c1a09c1 commit 848682c
Showing 1 changed file with 10 additions and 19 deletions.
29 changes: 10 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
FROM node:20-slim

ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true

RUN apt-get update && apt-get install -y \
wget \
gnupg \
ca-certificates \
--no-install-recommends

RUN apt-get update && apt-get install -y \
chromium \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

FROM node:20-slim AS builder
WORKDIR /usr/src/app

ENV PUPPETEER_SKIP_CHROME_DOWNLOAD=true
COPY ./web-service/package*.json ./
RUN npm install
RUN npm ci --only=production
COPY ./web-service .

EXPOSE 3000

CMD ["npm", "start"]
FROM node:20-slim
WORKDIR /usr/src/app
RUN apt-get update && apt-get install chromium -y --no-install-recommends
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
EXPOSE 3000
COPY --from=builder /usr/src/app .
CMD ["npm", "start"]

0 comments on commit 848682c

Please sign in to comment.