-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (52 loc) · 1.96 KB
/
Dockerfile
File metadata and controls
61 lines (52 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
FROM python:3.14-alpine
ARG BUILD_ENV
ARG IMAGE_VERSION
ENV TZ="Asia/Shanghai"
ENV UID=1000
ENV GID=1000
ENV WEBDAV_HOST="0.0.0.0"
ENV WEBDAV_PORT="8000"
ENV WEBDAV_CONFIGFILE="/data/webdav.toml"
ENV WEBDAV_LOGGING_LEVEL="INFO"
RUN if [ "$BUILD_ENV" = "rex" ]; then echo "Change depends" \
&& pip config set global.index-url https://proxpi.h.rexzhang.com/index/ \
&& pip config set install.trusted-host proxpi.h.rexzhang.com \
&& sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \
; fi
COPY requirements.d /app/requirements.d
COPY entrypoint.sh /app/entrypoint.sh
RUN \
# install python build depends ---
apk add --no-cache --virtual .build-deps build-base libffi-dev \
# --- LDAP
openldap-dev krb5-dev \
# --- build & install
&& pip install --no-cache-dir -r /app/requirements.d/docker.txt \
# --- cleanup
&& apk del .build-deps \
&& rm -rf /root/.cache \
&& find /usr/local/lib/python*/ -type f -name '*.py[cod]' -delete \
&& find /usr/local/lib/python*/ -type d -name "__pycache__" -delete \
# LDAP client's depends ---
&& apk add --no-cache libldap libsasl krb5-libs \
# create non-root user ---
&& apk add --no-cache su-exec \
# support timezone ---
&& apk add --no-cache tzdata \
# fix libexpat bug:
# out of memory: line 1, column 0
# https://bugs.launchpad.net/ubuntu/+source/python-xmltodict/+bug/1961800
&& apk add 'expat>2.4.7' \
# prepare ---
&& chmod +x /app/entrypoint.sh \
&& mkdir /data
COPY asgi_webdav /app/asgi_webdav
WORKDIR /app
VOLUME /data
EXPOSE 8000
CMD [ "/app/entrypoint.sh" ]
LABEL org.opencontainers.image.title="ASGI WebDAV Server"
LABEL org.opencontainers.image.version="$IMAGE_VERSION"
LABEL org.opencontainers.image.authors="Rex Zhang"
#LABEL org.opencontainers.image.url="https://hub.docker.com/repository/docker/ray1ex/asgi-webdav"
LABEL org.opencontainers.image.source="https://github.com/rexzhang/asgi-webdav"