| FROM alpine:latest |
|
|
| |
| ARG USER_ID=1000 |
| ARG GROUP_ID=1000 |
| RUN addgroup -g $GROUP_ID appuser && \ |
| adduser -u $USER_ID -G appuser -s /bin/sh -D appuser |
|
|
| WORKDIR /opt/cloudreve |
|
|
| ENV TZ=Asia/Shanghai |
|
|
| |
| RUN apk update && \ |
| apk add --no-cache wget unzip python3 py3-pip bash tar gzip jq curl && \ |
| rm -rf /var/cache/apk/* |
|
|
| RUN wget -O cloudreve.tar.gz "https://github.com/cloudreve/Cloudreve/releases/download/3.8.3/cloudreve_3.8.3_linux_amd64.tar.gz" && \ |
| tar -zxvf cloudreve.tar.gz && \ |
| rm cloudreve.tar.gz |
|
|
| RUN mkdir -p /opt/cloudreve/data |
|
|
| |
| RUN chown -R appuser:appuser /opt/cloudreve |
|
|
| ENV VIRTUAL_ENV=/opt/venv |
| RUN python3 -m venv $VIRTUAL_ENV |
| ENV PATH="$VIRTUAL_ENV/bin:$PATH" |
| RUN pip install --no-cache-dir requests webdavclient3 |
| RUN pip install --upgrade webdavclient3 |
|
|
| COPY sync_data.sh /opt/cloudreve/ |
| RUN chown appuser:appuser /opt/cloudreve/sync_data.sh |
| RUN chmod +x /opt/cloudreve/sync_data.sh |
|
|
| USER appuser |
|
|
| EXPOSE 5212 |
|
|
| CMD ["/bin/sh", "-c", "/opt/cloudreve/cloudreve -c /opt/cloudreve/config.ini & /opt/cloudreve/sync_data.sh"] |