rhk1999 commited on
Commit
ee5b380
·
verified ·
1 Parent(s): 2104f98

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +43 -0
Dockerfile ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM alpine:edge as builder
2
+ LABEL stage=go-builder
3
+ WORKDIR /app/
4
+ RUN apk add --no-cache bash curl gcc git go musl-dev
5
+ COPY go.mod go.sum ./
6
+ RUN go mod download
7
+ COPY ./ ./
8
+ RUN bash build.sh release docker
9
+
10
+ FROM alpine:edge
11
+
12
+ ARG INSTALL_FFMPEG=false
13
+ ARG INSTALL_ARIA2=false
14
+ LABEL MAINTAINER="i@nn.ci"
15
+
16
+ WORKDIR /opt/alist/
17
+
18
+ RUN apk update && \
19
+ apk upgrade --no-cache && \
20
+ apk add --no-cache bash ca-certificates su-exec tzdata; \
21
+ [ "$INSTALL_FFMPEG" = "true" ] && apk add --no-cache ffmpeg; \
22
+ [ "$INSTALL_ARIA2" = "true" ] && apk add --no-cache curl aria2 && \
23
+ mkdir -p /opt/aria2/.aria2 && \
24
+ wget https://github.com/P3TERX/aria2.conf/archive/refs/heads/master.tar.gz -O /tmp/aria-conf.tar.gz && \
25
+ tar -zxvf /tmp/aria-conf.tar.gz -C /opt/aria2/.aria2 --strip-components=1 && rm -f /tmp/aria-conf.tar.gz && \
26
+ sed -i 's|rpc-secret|#rpc-secret|g' /opt/aria2/.aria2/aria2.conf && \
27
+ sed -i 's|/root/.aria2|/opt/aria2/.aria2|g' /opt/aria2/.aria2/aria2.conf && \
28
+ sed -i 's|/root/.aria2|/opt/aria2/.aria2|g' /opt/aria2/.aria2/script.conf && \
29
+ sed -i 's|/root|/opt/aria2|g' /opt/aria2/.aria2/aria2.conf && \
30
+ sed -i 's|/root|/opt/aria2|g' /opt/aria2/.aria2/script.conf && \
31
+ touch /opt/aria2/.aria2/aria2.session && \
32
+ /opt/aria2/.aria2/tracker.sh ; \
33
+ rm -rf /var/cache/apk/*
34
+
35
+ COPY --from=builder /app/bin/alist ./
36
+ COPY entrypoint.sh /entrypoint.sh
37
+ RUN chmod +x /opt/alist/alist && \
38
+ chmod +x /entrypoint.sh && /entrypoint.sh version
39
+
40
+ ENV PUID=0 PGID=0 UMASK=022 RUN_ARIA2=${INSTALL_ARIA2}
41
+ VOLUME /opt/alist/data/
42
+ EXPOSE 5244 5245
43
+ CMD [ "/entrypoint.sh" ]