56 lines
1.4 KiB
Docker
56 lines
1.4 KiB
Docker
# Flood UI only: connects to an external torrent service. No bundled rTorrent.
|
|
# Build from a clean upstream release checkout using the Gitea workflow.
|
|
|
|
ARG BUILDPLATFORM=amd64
|
|
ARG NODE_IMAGE=docker.io/node:22-alpine3.24
|
|
|
|
FROM --platform=$BUILDPLATFORM ${NODE_IMAGE} as nodebuild
|
|
|
|
WORKDIR /usr/src/app/
|
|
|
|
# Copy project files
|
|
COPY . ./
|
|
|
|
# Flood v4.7.0 uses package-lock.json, not pnpm.
|
|
RUN npm ci --legacy-peer-deps --omit=optional
|
|
|
|
# The v4.7 Webpack toolchain needs legacy hashing with modern Node/OpenSSL.
|
|
# This option applies only to asset compilation, not the running server.
|
|
RUN NODE_OPTIONS=--openssl-legacy-provider 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
|
|
|
|
# Run as "download" user
|
|
# USER download
|
|
|
|
# Expose port 3000 and 4200
|
|
EXPOSE 3000
|
|
EXPOSE 4200
|
|
|
|
# Creating mountpoint for config
|
|
RUN mkdir -p /server/db/
|
|
RUN apk update
|
|
RUN apk add coreutils
|
|
|
|
# System local configuration
|
|
VOLUME /server/db/
|
|
|
|
# Fail the build before publication if the actual server cannot start.
|
|
RUN node .ci-startup.cjs && rm .ci-startup.cjs
|
|
|
|
# Flood server in development mode
|
|
ENTRYPOINT ["npm", "--prefix=/usr/src/app/", "run", "start:development:server", "--", "--host=0.0.0.0", "--rundir=/server/"]
|