mirror of
https://github.com/dadosfera/maestro.git
synced 2026-08-31 19:58:21 +00:00
48 lines
1.1 KiB
Docker
48 lines
1.1 KiB
Docker
FROM node:22-alpine AS base_image
|
|
RUN npm install -g npm@latest
|
|
|
|
FROM base_image AS build_base
|
|
WORKDIR /app
|
|
RUN apk update
|
|
RUN apk add --no-cache \
|
|
aws-cli \
|
|
chromium \
|
|
nss \
|
|
freetype \
|
|
harfbuzz \
|
|
ca-certificates \
|
|
ttf-freefont
|
|
COPY package*.json ./
|
|
|
|
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
|
|
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
|
|
|
|
|
# Local build with secrets
|
|
FROM build_base AS build
|
|
RUN --mount=type=secret,id=aws,target=/root/.aws/credentials \
|
|
aws codeartifact login --tool npm --namespace @dadosfera --repository dadosfera-npm --domain dadosfera --domain-owner 611330257153 --region us-east-1
|
|
RUN npm ci --ignore-scripts
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
|
|
FROM base_image
|
|
WORKDIR /app
|
|
COPY --from=build /app/dist ./dist
|
|
COPY --from=build /app/node_modules ./node_modules
|
|
COPY --from=build /app/package*.json ./
|
|
RUN apk update
|
|
RUN apk add --no-cache \
|
|
chromium \
|
|
nss \
|
|
freetype \
|
|
harfbuzz \
|
|
ca-certificates \
|
|
ttf-freefont
|
|
|
|
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
|
|
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
|
|
|
ENTRYPOINT ["npm", "run", "start:prod"]
|