Adjust CI pipeline.
This commit is contained in:
5
.dockerignore
Normal file
5
.dockerignore
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
node_modules
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
*.md
|
||||||
|
dist
|
||||||
@@ -37,7 +37,7 @@ steps:
|
|||||||
- echo "$REGISTRY_PASSWORD" | docker login registry.binderlab.io --username "$REGISTRY_USERNAME" --password-stdin
|
- echo "$REGISTRY_PASSWORD" | docker login registry.binderlab.io --username "$REGISTRY_USERNAME" --password-stdin
|
||||||
- docker pull registry.binderlab.io/harbormaster-client:latest
|
- docker pull registry.binderlab.io/harbormaster-client:latest
|
||||||
- docker create --name temp-harbormaster-client registry.binderlab.io/harbormaster-client:latest
|
- docker create --name temp-harbormaster-client registry.binderlab.io/harbormaster-client:latest
|
||||||
- docker cp temp-harbormaster-client:/build $DEPLOY_PATH
|
- docker cp temp-harbormaster-client:/app/build $DEPLOY_PATH
|
||||||
- docker rm temp-harbormaster-client
|
- docker rm temp-harbormaster-client
|
||||||
when:
|
when:
|
||||||
event: manual
|
event: manual
|
||||||
@@ -1,23 +1,25 @@
|
|||||||
FROM node:18-alpine AS builder
|
FROM node:20-slim AS base
|
||||||
|
ENV PNPM_HOME="/pnpm"
|
||||||
# Set working directory
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
|
RUN corepack enable
|
||||||
|
COPY . /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy package.json and install dependencies
|
FROM base AS prod-deps
|
||||||
COPY package.json pnpm-lock.yaml ./
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
|
||||||
RUN npm ci
|
|
||||||
|
|
||||||
# Copy the rest of the app and build
|
FROM base AS build
|
||||||
COPY . .
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
||||||
RUN npm run build
|
RUN pnpm run build
|
||||||
|
|
||||||
# Stage 2: Minimal image for exporting build artifacts
|
# Stage 2: Minimal image for exporting build artifacts
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
|
|
||||||
# Set working directory for output
|
# Set working directory for output
|
||||||
WORKDIR /output
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy the built files from the builder stage
|
# Copy the built files from the builder stage
|
||||||
COPY --from=builder /app/build .
|
COPY --from=prod-deps /app/node_modules /app/node_modules
|
||||||
|
COPY --from=build /app/build .
|
||||||
|
|
||||||
# No CMD because this image is just used to extract build files
|
# No CMD because this image is just used to extract build files
|
||||||
Reference in New Issue
Block a user