mirror of
https://github.com/zoriya/flood.git
synced 2025-12-06 07:16:18 +00:00
Dockerfile: get rid of native build tools and fix up multi-arch
This commit is contained in:
20
Dockerfile
20
Dockerfile
@@ -9,24 +9,32 @@
|
||||
ARG BUILDPLATFORM=amd64
|
||||
ARG NODE_IMAGE=node:alpine
|
||||
|
||||
FROM --platform=$BUILDPLATFORM ${NODE_IMAGE}
|
||||
FROM --platform=$BUILDPLATFORM ${NODE_IMAGE} as nodebuild
|
||||
|
||||
WORKDIR /usr/src/app/
|
||||
|
||||
# Copy project files
|
||||
COPY . ./
|
||||
|
||||
# Install dependencies
|
||||
RUN apk --no-cache add \
|
||||
python build-base mediainfo
|
||||
|
||||
# Fetch dependencies from npm
|
||||
RUN npm ci --no-optional && npm cache clean --force
|
||||
RUN npm ci --no-optional
|
||||
|
||||
# Build assets
|
||||
RUN cp config.cli.js config.js
|
||||
RUN npm run build-assets
|
||||
|
||||
# Now get the clean Node.js image
|
||||
FROM ${NODE_IMAGE} as flood
|
||||
|
||||
WORKDIR /usr/src/app/
|
||||
|
||||
# Copy sources
|
||||
COPY --from=nodebuild /usr/src/app ./
|
||||
|
||||
# Install runtime dependencies
|
||||
RUN apk --no-cache add \
|
||||
mediainfo
|
||||
|
||||
# Create "download" user
|
||||
RUN adduser -h /home/download -s /sbin/nologin --disabled-password download
|
||||
|
||||
|
||||
Reference in New Issue
Block a user