Skip to content

ci: fix docker build with node:lts-alpine #7663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
############################################################
# Build stage
############################################################
FROM node:lts-alpine as build

RUN apk update; \
apk add git;
WORKDIR /tmp

# Copy package.json first to benefit from layer caching
COPY package*.json ./

# Copy local dependencies for CI tests
COPY spec/dependencies spec/dependencies
# Copy src to have config files for install
COPY . .

# Clean npm cache; added to fix an issue with the install process
RUN npm cache clean --force

# Install all dependencies
RUN npm ci
COPY . .

# Run build steps
RUN npm run build

############################################################
# Release stage
############################################################
FROM node:lts-alpine as release

RUN apk update; \
Expand All @@ -26,6 +36,7 @@ WORKDIR /parse-server

COPY package*.json ./

# Clean npm cache; added to fix an issue with the install process
RUN npm cache clean --force
RUN npm ci --production --ignore-scripts

Expand Down