mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
ci: updated dockerfile
This commit is contained in:
2
frontend/.dockerignore
Normal file
2
frontend/.dockerignore
Normal file
@@ -0,0 +1,2 @@
|
||||
# Ignore the .npmrc file
|
||||
.npmrc
|
||||
@@ -1,15 +1,26 @@
|
||||
FROM node:14 AS build
|
||||
# Build stage
|
||||
FROM node:20-alpine AS build
|
||||
|
||||
ADD . /app
|
||||
# Set the working directory in the container
|
||||
WORKDIR /app
|
||||
RUN rm /app/.npmrc
|
||||
|
||||
# install frontend
|
||||
RUN npm i -g pnpm@7
|
||||
RUN pnpm install
|
||||
# Install pnpm
|
||||
RUN npm install -g pnpm
|
||||
|
||||
# Copy package.json and pnpm-lock.yaml
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
|
||||
# Install project dependencies
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
# Copy the rest of the application code
|
||||
COPY . .
|
||||
|
||||
# Build the application
|
||||
RUN pnpm run build
|
||||
|
||||
# Production stage
|
||||
FROM alpine:3.14
|
||||
|
||||
# copy files
|
||||
# Copy only the built artifacts from the build stage
|
||||
COPY --from=build /app/dist /app/dist
|
||||
|
||||
Reference in New Issue
Block a user