chore: ship curl/unzip/jq in runtime image and translate comments to English
This commit is contained in:
parent
fdc40da561
commit
1b118cf0b7
@ -1,43 +1,44 @@
|
||||
# 1) Télécharger et unzipper slskd
|
||||
FROM debian:bookworm-slim AS downloader
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
curl ca-certificates unzip jq \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
# -------- 1. Build stage: fetch latest slskd --------
|
||||
FROM debian:bookworm-slim AS build
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
curl ca-certificates unzip jq \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /tmp
|
||||
ARG TARGETPLATFORM
|
||||
RUN TAG=$(curl -fsSL https://api.github.com/repos/slskd/slskd/releases/latest \
|
||||
| jq -r '.tag_name') \
|
||||
&& case "${TARGETPLATFORM}" in \
|
||||
"linux/amd64") URL="https://github.com/slskd/slskd/releases/download/${TAG}/slskd-${TAG}-linux-x64.zip" ;; \
|
||||
"linux/arm64") URL="https://github.com/slskd/slskd/releases/download/${TAG}/slskd-${TAG}-linux-arm64.zip" ;; \
|
||||
*) echo "Unsupported PLATFORM: ${TARGETPLATFORM}" >&2; exit 1 ;; \
|
||||
esac \
|
||||
&& curl -fsSL "$URL" -o slskd.zip \
|
||||
&& unzip slskd.zip
|
||||
|
||||
# 2) Image finale
|
||||
RUN TAG=$(curl -fsSL https://api.github.com/repos/slskd/slskd/releases/latest | jq -r '.tag_name') && \
|
||||
case "${TARGETPLATFORM}" in \
|
||||
"linux/amd64") URL="https://github.com/slskd/slskd/releases/download/${TAG}/slskd-${TAG}-linux-x64.zip" ;; \
|
||||
"linux/arm64") URL="https://github.com/slskd/slskd/releases/download/${TAG}/slskd-${TAG}-linux-arm64.zip" ;; \
|
||||
*) echo "Unsupported platform ${TARGETPLATFORM}" >&2; exit 1 ;; \
|
||||
esac && \
|
||||
curl -fsSL "$URL" -o slskd.zip && \
|
||||
unzip slskd.zip
|
||||
|
||||
# -------- 2. Runtime stage --------
|
||||
FROM debian:bookworm-slim
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
tini jq ca-certificates gosu libstdc++6 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Créer les répertoires code, data et cache
|
||||
RUN mkdir -p /app/code /app/data /run/slskd/cache \
|
||||
&& useradd -u 1000 -m -d /app/data -s /bin/bash cloudron \
|
||||
&& chown -R cloudron:cloudron /app/data /run/slskd/cache
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
tini gosu libstdc++6 \
|
||||
curl ca-certificates unzip jq \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copier binaire + UI statique
|
||||
COPY --from=downloader /tmp/slskd /app/code/slskd
|
||||
COPY --from=downloader /tmp/wwwroot /app/code/wwwroot
|
||||
# Minimal filesystem layout
|
||||
RUN mkdir -p /app/code /app/data /run/slskd/cache && \
|
||||
useradd -u 1000 -m -d /app/data -s /bin/bash cloudron && \
|
||||
chown -R cloudron:cloudron /app/data /run/slskd/cache
|
||||
|
||||
# Copier config example et script de démarrage
|
||||
COPY slskd.yml.example /app/code/slskd.yml.example
|
||||
COPY start.sh /app/code/start.sh
|
||||
# Copy binaries + static UI
|
||||
COPY --from=build /tmp/slskd /app/code/slskd
|
||||
COPY --from=build /tmp/wwwroot /app/code/wwwroot
|
||||
|
||||
RUN chmod +x /app/code/slskd /app/code/start.sh \
|
||||
&& chown -R cloudron:cloudron /app/code
|
||||
# Config + startup
|
||||
COPY slskd.yml.example /app/code/slskd.yml.example
|
||||
COPY start.sh /app/code/start.sh
|
||||
|
||||
RUN chmod +x /app/code/slskd /app/code/start.sh && \
|
||||
chown -R cloudron:cloudron /app/code
|
||||
|
||||
WORKDIR /app/code
|
||||
ENTRYPOINT ["/usr/bin/tini", "--"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user