forked from teknologist/docker-webnut
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (19 loc) · 917 Bytes
/
Dockerfile
File metadata and controls
26 lines (19 loc) · 917 Bytes
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
# syntax=docker/dockerfile:1
FROM python:3.13-alpine3.23
LABEL maintainer=edgd1er@hotmail.com
EXPOSE 6543
WORKDIR /app/
#hadolint ignore=DL3018
RUN adduser -D user && apk add --no-cache bash git curl \
&& git clone https://github.com/rshipp/webNUT.git \
&& sed -i "s/ 'nut2',/ 'nut2-notl',/" webNUT/setup.py \
&& pip install --no-cache-dir --upgrade -e webNUT \
&& mkdir /config && touch /config/config.py && chown user:users /config/config.py /config \
&& echo "alias checkhealth='curl -f http://localhost:6543 || exit 1'" >>/home/user/.bashrc \
&& chown user:users /home/user/.bashrc
COPY --chown=user --chmod=555 docker-entrypoint.sh /docker-entrypoint.sh
RUN ln -sf /config/config.py /app/webNUT/webnut/config.py
VOLUME /config
HEALTHCHECK --interval=10s --timeout=10s --retries=5 CMD curl -f http://0.0.0.0:6543 2>&1 || exit 1
USER user
ENTRYPOINT ["/docker-entrypoint.sh"]