-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Dockerfile for arm64 build support on export feature
- Loading branch information
Showing
7 changed files
with
848 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,63 @@ | ||
# Stage 1: build codepair backend | ||
# Start from the node base image | ||
FROM node:alpine3.18 AS builder | ||
|
||
# Set the Current Working Directory inside the container | ||
WORKDIR /app | ||
|
||
# Copy the source from the current directory to the Working Directory inside the container | ||
COPY . . | ||
# Dependency for Prisma | ||
|
||
# Download dependency for Prisma | ||
RUN apk upgrade --update-cache --available && \ | ||
apk add openssl && \ | ||
rm -rf /var/cache/apk/* | ||
|
||
# Download dependencies for Puppeteer | ||
RUN apk add --no-cache \ | ||
chromium \ | ||
nss \ | ||
freetype \ | ||
harfbuzz \ | ||
ca-certificates \ | ||
ttf-freefont | ||
|
||
# Install dependencies | ||
RUN npm ci | ||
|
||
# Build codepair backend | ||
RUN npm run build | ||
|
||
# Stage 2: copy build outputs and dependencies for actual image | ||
FROM node:alpine3.18 | ||
|
||
# Set the Current Working Directory inside the container | ||
WORKDIR /app | ||
ENV NODE_ENV production | ||
|
||
# Get and copy the build outputs from the builder stage | ||
COPY --from=builder /app ./ | ||
# Dependency for Prisma | ||
|
||
# Download dependency for Prisma | ||
RUN apk upgrade --update-cache --available && \ | ||
apk add openssl && \ | ||
rm -rf /var/cache/apk/* | ||
|
||
# # Dependency for Puppeteer | ||
# RUN apk add --no-cache \ | ||
# chromium \ | ||
# nss \ | ||
# freetype \ | ||
# harfbuzz \ | ||
# ca-certificates \ | ||
# ttf-freefont | ||
# Download dependencies for Puppeteer | ||
RUN apk add --no-cache \ | ||
chromium \ | ||
nss \ | ||
freetype \ | ||
harfbuzz \ | ||
ca-certificates \ | ||
ttf-freefont | ||
|
||
# ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true | ||
# ENV PUPPETEER_EXECUTABLE_PATH /usr/bin/chromium-browser | ||
# Set the environment variables | ||
ENV NODE_ENV production | ||
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true | ||
ENV PUPPETEER_EXECUTABLE_PATH /usr/bin/chromium-browser | ||
|
||
# Expose port 3000 to the outside world | ||
EXPOSE 3000 | ||
|
||
# Run the backend server | ||
CMD ["npm", "run", "start:prod"] |
Oops, something went wrong.