# syntax=docker/dockerfile:1 FROM alpine:3.22 LABEL \ org.opencontainers.image.title="Stash" \ org.opencontainers.image.description="An organizer for your porn, written in Go." \ org.opencontainers.image.url="https://github.com/nerethos/docker-stash" \ org.opencontainers.image.documentation="https://docs.stashapp.cc" \ org.opencontainers.image.source="https://github.com/nerethos/docker-stash" \ org.opencontainers.image.authors="nerethos" ENV \ HOME="/root" \ TZ="Etc/UTC" \ # stash environment variables STASH_CONFIG_FILE="/root/.stash/config.yml" \ PY_VENV="/pip-install/venv" \ PATH="/pip-install/venv/bin:$PATH" ARG TARGETPLATFORM ARG TARGETARCH ARG TARGETVARIANT RUN \ apk add --no-cache \ bash \ ca-certificates \ curl \ ffmpeg \ python3 \ py3-requests \ py3-requests-toolbelt \ py3-lxml \ py3-pip \ shadow \ tzdata \ vips \ vips-tools RUN \ set -ex && \ echo "TARGETPLATFORM=$TARGETPLATFORM" && \ echo "TARGETARCH=$TARGETARCH" && \ echo "TARGETVARIANT=$TARGETVARIANT" && \ case "${TARGETARCH}${TARGETVARIANT}" in \ "amd64") STASH_ARCH="stash-linux" ;; \ "armv7") STASH_ARCH="stash-linux-arm32v7" ;; \ "armv6") STASH_ARCH="stash-linux-arm32v6" ;; \ "arm64") STASH_ARCH="stash-linux-arm64v8" ;; \ *) echo "Unsupported architecture: ${TARGETARCH}${TARGETVARIANT}"; exit 1 ;; \ esac && \ if [ -z ${STASH_RELEASE+x} ]; then \ STASH_RELEASE=$(curl -sX GET "https://api.github.com/repos/stashapp/stash/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ curl -o \ /usr/bin/stash -L \ "https://github.com/stashapp/stash/releases/download/${STASH_RELEASE}/${STASH_ARCH}" && \ chmod +x /usr/bin/stash RUN \ useradd -u 1000 -U -d /config -s /bin/false stash && \ usermod -G users stash && \ usermod -G video stash RUN \ apk del curl COPY --chmod=755 entrypoint.sh /usr/local/bin EXPOSE 9999 CMD ["entrypoint.sh"]