container: use node-alpine image
This commit is contained in:
parent
eab42ceae5
commit
905cc665f8
1 changed files with 5 additions and 8 deletions
13
Dockerfile
13
Dockerfile
|
@ -1,9 +1,9 @@
|
||||||
## Install dev and compilation dependencies, build files
|
## Install dev and compilation dependencies, build files
|
||||||
FROM docker.io/node:20-slim as build
|
FROM docker.io/node:20-alpine as build
|
||||||
WORKDIR /firefish
|
WORKDIR /firefish
|
||||||
|
|
||||||
# Install compilation dependencies
|
# Install compilation dependencies
|
||||||
RUN apt-get update && DEBIAN_FRONTEND='noninteractive' apt-get install -y --no-install-recommends curl build-essential ca-certificates python3
|
RUN apk update && apk add build-base curl ca-certificates python3
|
||||||
RUN curl --proto '=https' --tlsv1.2 --silent --show-error --fail https://sh.rustup.rs | sh -s -- -y
|
RUN curl --proto '=https' --tlsv1.2 --silent --show-error --fail https://sh.rustup.rs | sh -s -- -y
|
||||||
ENV PATH="/root/.cargo/bin:${PATH}"
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
||||||
|
|
||||||
|
@ -44,14 +44,11 @@ RUN NODE_ENV='production' pnpm run --recursive --parallel --filter '!backend-rs'
|
||||||
RUN find . -path '*/node_modules/*' -delete && pnpm install --prod --frozen-lockfile
|
RUN find . -path '*/node_modules/*' -delete && pnpm install --prod --frozen-lockfile
|
||||||
|
|
||||||
## Runtime container
|
## Runtime container
|
||||||
FROM docker.io/node:20-slim
|
FROM docker.io/node:20-alpine
|
||||||
WORKDIR /firefish
|
WORKDIR /firefish
|
||||||
|
|
||||||
# Install runtime dependencies
|
# Install runtime dependencies
|
||||||
RUN apt-get update && DEBIAN_FRONTEND='noninteractive' apt-get install -y --no-install-recommends zip unzip tini ffmpeg ca-certificates
|
RUN apk update && apk add zip unzip tini ffmpeg
|
||||||
|
|
||||||
RUN echo 'deb https://deb.debian.org/debian experimental main' | tee /etc/apt/sources.list
|
|
||||||
RUN apt-get update && DEBIAN_FRONTEND='noninteractive' apt-get --target-release experimental install -y --no-install-recommends libc6
|
|
||||||
|
|
||||||
COPY . ./
|
COPY . ./
|
||||||
|
|
||||||
|
@ -73,5 +70,5 @@ COPY --from=build /firefish/packages/backend-rs/built /firefish/packages/backend
|
||||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
VOLUME "/firefish/files"
|
VOLUME "/firefish/files"
|
||||||
ENTRYPOINT [ "/usr/bin/tini", "--" ]
|
ENTRYPOINT [ "/sbin/tini", "--" ]
|
||||||
CMD [ "pnpm", "run", "start:container" ]
|
CMD [ "pnpm", "run", "start:container" ]
|
||||||
|
|
Loading…
Reference in a new issue