-
Notifications
You must be signed in to change notification settings - Fork 1
/
ci.Dockerfile
31 lines (22 loc) · 997 Bytes
/
ci.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
29
30
31
# This Dockerfile is used to build the GitHub Actions Runner image used in the CI pipeline.
# It doesn't has the ENTRYPOINT instruction, so it can't be used to run the image as a container.
# The ENTRYPOINT instruction is added in the Dockerfile in the root of the project.
# Stage 1: Build environment
FROM node:20.12.2-bookworm-slim AS builder
# Install PNPM globally with a specific version
RUN npm install -g [email protected]
# Set the working directory in the Docker image
WORKDIR /app
# Copy package.json and pnpm-lock.yaml first for better caching
COPY package.json pnpm-lock.yaml ./
# Install dependencies
RUN pnpm install --frozen-lockfile
# Copy the rest of your app's source code
COPY . .
# Build your app
RUN pnpm run build
# Stage 2: Runtime environment
FROM node:20.12.2-bookworm-slim AS runtime
# Copy only the built executable and set permissions
COPY --from=builder /app/dist/bin/index.js /usr/local/bin/github-actions-runner
RUN chmod +x /usr/local/bin/github-actions-runner