mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2026-10-10 04:53:09 +08:00
37 lines
1.1 KiB
Docker
37 lines
1.1 KiB
Docker
### Default image is base. You can add other support by modifying BASE_IMAGE_TAG. The following parameters are supported: base (default), aria2, ffmpeg, aio
|
|
ARG BASE_IMAGE_TAG=base@sha256:042e7139b7daf131b15bb582c2e9f1ce0f8bf2b3e9ac04a5368bf3088c2d73c2
|
|
|
|
FROM alpine:edge AS builder
|
|
LABEL stage=go-builder
|
|
WORKDIR /app/
|
|
RUN apk add --no-cache bash curl jq gcc git go musl-dev
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY ./ ./
|
|
RUN bash build.sh release docker
|
|
|
|
FROM openlistteam/openlist-base-image:${BASE_IMAGE_TAG}
|
|
LABEL MAINTAINER="OpenList"
|
|
ARG INSTALL_FFMPEG=false
|
|
ARG INSTALL_ARIA2=false
|
|
ARG USER=openlist
|
|
ARG UID=1001
|
|
ARG GID=1001
|
|
|
|
WORKDIR /opt/openlist/
|
|
|
|
RUN addgroup -g ${GID} ${USER} && \
|
|
adduser -D -u ${UID} -G ${USER} ${USER} && \
|
|
mkdir -p /opt/openlist/data
|
|
|
|
COPY --from=builder --chmod=755 --chown=${UID}:${GID} /app/bin/openlist ./
|
|
COPY --chmod=755 --chown=${UID}:${GID} entrypoint.sh /entrypoint.sh
|
|
|
|
USER ${USER}
|
|
RUN /entrypoint.sh version
|
|
|
|
ENV UMASK=022 RUN_ARIA2=${INSTALL_ARIA2}
|
|
VOLUME /opt/openlist/data/
|
|
EXPOSE 5244 5245
|
|
CMD [ "/entrypoint.sh" ]
|