-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
56 lines (51 loc) · 2.35 KB
/
Dockerfile
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
FROM ghcr.io/sdr-enthusiasts/docker-baseimage:python
ENV GEOIP_RESPONSECODE=403
ENV BLOCKBOT_RESPONSECODE=403
ENV LOGROTATE_INTERVAL=3600
ENV LOGROTATE_MAXBACKUPS=24
ENV IPTABLES_JAILTIME=0
LABEL org.opencontainers.image.source = "https://github.com/sdr-enthusiasts/docker-reversewebproxy"
#hadolint ignore=DL3008,SC3054
RUN set -x && \
# define packages needed for installation and general management of the container:
TEMP_PACKAGES=() && \
KEPT_PACKAGES=() && \
KEPT_PACKAGES+=(nginx) && \
KEPT_PACKAGES+=(python3-certbot-nginx) && \
KEPT_PACKAGES+=(psmisc) && \
KEPT_PACKAGES+=(libnginx-mod-http-geoip) && \
KEPT_PACKAGES+=(geoip-database) && \
KEPT_PACKAGES+=(iptables) && \
KEPT_PACKAGES+=(jq) && \
TEMP_PACKAGES+=(gpg) && \
# added for debugging
KEPT_PACKAGES+=(procps nano aptitude netcat-openbsd libnginx-mod-http-echo) && \
#
# Install all these packages:
apt-get update && \
apt-get install -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -o Dpkg::Options::="--force-confold" --force-yes -y --no-install-recommends --no-install-suggests\
${KEPT_PACKAGES[@]} \
${TEMP_PACKAGES[@]} && \
# Added for GoAccess server report - see https://goaccess.io/
mkdir -p /usr/share/keyrings && \
curl -sSL https://deb.goaccess.io/gnugpg.key | gpg --dearmor > /usr/share/keyrings/goaccess.gpg && \
echo "deb [signed-by=/usr/share/keyrings/goaccess.gpg arch=$(dpkg --print-architecture)] https://deb.goaccess.io/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/goaccess.list && \
apt-get update && \
apt-get install -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -o Dpkg::Options::="--force-confold" --force-yes -y --no-install-recommends --no-install-suggests\
goaccess && \
#
# Clean up:
apt-get remove -y ${TEMP_PACKAGES[@]} && \
apt-get autoremove -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -y && \
apt-get clean -y && \
rm -rf /src/* /tmp/* /var/lib/apt/lists/* /usr/share/keyrings/goaccess.gpg && \
#
# Do some other stuff
echo "alias dir=\"ls -alsv\"" >> /root/.bashrc && \
echo "alias nano=\"nano -l\"" >> /root/.bashrc && \
echo "PATH=/root:\$PATH" >> /root/.bashrc
# Copy the rootfs into place:
#
COPY rootfs/ /
EXPOSE 80
EXPOSE 443