-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
24 lines (17 loc) · 980 Bytes
/
Copy pathDockerfile
File metadata and controls
24 lines (17 loc) · 980 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
FROM debian:latest
RUN apt-get -y update && \
apt-get -y install lighttpd nut-cgi curl
RUN apt-get -y autoremove && \
apt-get clean all && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN rm -f /etc/lighttpd/conf-enabled/*-unconfigured.conf && \
ln -s /etc/lighttpd/conf-available/*-accesslog.conf /etc/lighttpd/conf-enabled/ && \
ln -s /etc/lighttpd/conf-available/*-cgi.conf /etc/lighttpd/conf-enabled/
RUN sed -i 's|/cgi-bin/|/|g' /etc/lighttpd/conf-enabled/*-cgi.conf && \
sed -i 's|^\(server.document-root.*=\).*|\1 "/usr/lib/cgi-bin/nut"|g' /etc/lighttpd/lighttpd.conf && \
sed -i 's|^\(index-file.names.*=\).*|\1 ( "upsstats.cgi" )|g' /etc/lighttpd/lighttpd.conf && \
sed -i '/alias.url/d' /etc/lighttpd/conf-enabled/*-cgi.conf
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
CMD curl -f http://localhost/ || exit 1
EXPOSE 80
ENTRYPOINT ["/usr/sbin/lighttpd", "-D", "-f", "/etc/lighttpd/lighttpd.conf"]