-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.prebuilt
More file actions
54 lines (41 loc) · 1.92 KB
/
Copy pathDockerfile.prebuilt
File metadata and controls
54 lines (41 loc) · 1.92 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
# SlimServe Dockerfile
# Multi-stage build for minimal production image
FROM alpine:latest
ARG TARGETARCH
ARG REPOWN
RUN apk add --no-cache \
ca-certificates \
wget \
curl \
jq \
&& rm -rf /var/cache/apk/*
RUN addgroup -g 1001 -S slimserve && \
adduser -u 1001 -S slimserve -G slimserve
RUN mkdir -p /data && \
chown slimserve:slimserve /data
RUN set -eux; \
full_digest=$(curl -s "https://api.github.com/repos/$REPOWN/slimserve/releases/latest" \
| jq -r ".assets[] | select(.name==\"slimserve_$TARGETARCH\") | .digest"); \
digest=${full_digest#sha256:}; \
until wget -q -O /usr/local/bin/slimserve "https://github.com/$REPOWN/slimserve/releases/latest/download/slimserve_$TARGETARCH" && \
echo "$digest /usr/local/bin/slimserve" | sha256sum -c -; do \
echo "Checksum verification failed, retrying..."; \
sleep 1; \
done
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/slimserve && \
chmod +x /usr/local/bin/docker-entrypoint.sh
RUN mkdir -p /etc/slimserve && \
chown slimserve:slimserve /etc/slimserve
USER slimserve
WORKDIR /data
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/ || exit 1
ENV CONFIG_FILE=/etc/slimserve/config.json
LABEL maintainer="xeome" \
description="Lightweight, efficient file server with admin interface. Environment variables: SLIMSERVE_HOST, SLIMSERVE_PORT, SLIMSERVE_DIRS, SLIMSERVE_DISABLE_DOTFILES, SLIMSERVE_LOG_LEVEL, SLIMSERVE_ENABLE_AUTH, SLIMSERVE_USERNAME, SLIMSERVE_PASSWORD, SLIMSERVE_ENABLE_ADMIN, SLIMSERVE_ADMIN_USERNAME, SLIMSERVE_ADMIN_PASSWORD, SLIMSERVE_MAX_UPLOAD_SIZE_MB, CONFIG_FILE" \
version="1.0" \
org.opencontainers.image.source="https://github.com/xeome/slimserve"
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["-port", "8080", "-dirs", "/data"]