mirror of
https://github.com/stonith404/pingvin-share.git
synced 2025-01-29 01:28:59 -05:00
fix: use node slim to fix arm builds
This commit is contained in:
parent
8e38c5fed7
commit
797f8938ca
1 changed files with 9 additions and 7 deletions
16
Dockerfile
16
Dockerfile
|
@ -1,25 +1,27 @@
|
|||
# Using node slim because prisma ORM needs libc for ARM builds
|
||||
|
||||
# Stage 1: on frontend dependency change
|
||||
FROM node:18-alpine AS frontend-dependencies
|
||||
FROM node:18-slim AS frontend-dependencies
|
||||
WORKDIR /opt/app
|
||||
COPY frontend/package.json frontend/package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
# Stage 2: on frontend change
|
||||
FROM node:18-alpine AS frontend-builder
|
||||
FROM node:18-slim AS frontend-builder
|
||||
WORKDIR /opt/app
|
||||
COPY ./frontend .
|
||||
COPY --from=frontend-dependencies /opt/app/node_modules ./node_modules
|
||||
RUN npm run build
|
||||
|
||||
# Stage 3: on backend dependency change
|
||||
FROM node:18-alpine AS backend-dependencies
|
||||
FROM node:18-slim AS backend-dependencies
|
||||
WORKDIR /opt/app
|
||||
COPY backend/package.json backend/package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
# Stage 4:on backend change
|
||||
FROM node:18-alpine AS backend-builder
|
||||
RUN apk add --update openssl
|
||||
FROM node:18-slim AS backend-builder
|
||||
RUN apt-get update && apt-get install -y openssl
|
||||
WORKDIR /opt/app
|
||||
COPY ./backend .
|
||||
COPY --from=backend-dependencies /opt/app/node_modules ./node_modules
|
||||
|
@ -27,9 +29,9 @@ RUN npx prisma generate
|
|||
RUN npm run build && npm prune --production
|
||||
|
||||
# Stage 5: Final image
|
||||
FROM node:18-alpine AS runner
|
||||
FROM node:18-slim AS runner
|
||||
ENV NODE_ENV=production
|
||||
RUN apk add --update openssl
|
||||
RUN apt-get update && apt-get install -y openssl
|
||||
|
||||
WORKDIR /opt/app/frontend
|
||||
COPY --from=frontend-builder /opt/app/public ./public
|
||||
|
|
Loading…
Add table
Reference in a new issue