-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
28 lines (23 loc) · 1.01 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
ENV FILTERS=""
ENV COMMAND="start"
RUN corepack enable
# Install curl and add Infisical CLI
RUN apt-get update && apt-get install -y curl
RUN curl -1sLf 'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.deb.sh' | bash
RUN apt-get update && apt-get install -y infisical
COPY . /app
WORKDIR /app
RUN chmod +x ./entrypoint.sh
# Define build arguments for Infisical credentials
ARG INFISICAL_CLIENT_ID
ARG INFISICAL_CLIENT_SECRET
ARG INFISICAL_PROJECT_ID
RUN infisical run --token=$(infisical login --method=universal-auth --client-id="$INFISICAL_CLIENT_ID" --client-secret="$INFISICAL_CLIENT_SECRET" --silent --plain) --projectId="$INFISICAL_PROJECT_ID" --env="prod" -- bash -c 'pnpm config set "//registry.npmjs.org/:_authToken" "${NPM_TOKEN}"'
# Unified installation and build step
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod=false --ignore-scripts
RUN bash -c 'pnpm run build'
EXPOSE 3000
ENTRYPOINT ["./entrypoint.sh"]