2023-12-20 15:10:14 +01:00
|
|
|
FROM rockylinux/rockylinux:9-ubi
|
2018-11-21 00:01:51 +01:00
|
|
|
|
2023-12-23 21:45:09 +01:00
|
|
|
RUN arch=$([ "$(arch)" = 'aarch64' ] && echo -n 'arm64' || echo -n 'amd64') \
|
|
|
|
&& echo 'install_weak_deps=False' >> /etc/dnf/dnf.conf \
|
2023-12-20 15:10:14 +01:00
|
|
|
&& echo 'tsflags=nodocs' >> /etc/dnf/dnf.conf \
|
2023-12-19 22:20:10 +01:00
|
|
|
&& echo 'assumeyes=True' >> /etc/dnf/dnf.conf \
|
|
|
|
&& curl -fsSL -o /etc/yum.repos.d/yarn.repo https://dl.yarnpkg.com/rpm/yarn.repo \
|
2024-01-03 19:27:25 +01:00
|
|
|
&& dnf module enable nodejs:20 postgresql:15 \
|
2024-01-01 20:39:33 +01:00
|
|
|
&& dnf install dnf-plugins-core epel-release \
|
|
|
|
&& dnf config-manager --set-disabled epel-cisco-openh264 \
|
|
|
|
&& dnf config-manager --set-enabled crb \
|
2023-12-19 22:20:10 +01:00
|
|
|
&& dnf --refresh upgrade \
|
|
|
|
&& dnf install \
|
2024-01-01 20:39:33 +01:00
|
|
|
caddy \
|
|
|
|
mariadb \
|
2023-12-20 15:10:14 +01:00
|
|
|
npm \
|
2024-01-03 19:27:25 +01:00
|
|
|
postgresql \
|
2023-12-17 02:38:00 +01:00
|
|
|
python3-cffi \
|
2018-11-21 00:01:51 +01:00
|
|
|
python3-ldap \
|
2023-02-24 00:40:12 +01:00
|
|
|
python3-lxml \
|
2023-12-20 15:10:14 +01:00
|
|
|
python3-mysqlclient \
|
2020-01-03 17:52:23 +01:00
|
|
|
python3-pip \
|
2024-01-03 19:27:25 +01:00
|
|
|
python3-psycopg2 \
|
2023-12-17 02:38:00 +01:00
|
|
|
python3-pyyaml \
|
2023-02-24 00:40:12 +01:00
|
|
|
python3-saml \
|
2018-11-21 00:01:51 +01:00
|
|
|
python3-xmlsec \
|
2024-01-01 20:39:33 +01:00
|
|
|
supervisor \
|
2018-11-21 00:01:51 +01:00
|
|
|
uwsgi \
|
2024-01-01 20:39:33 +01:00
|
|
|
uwsgi-plugin-python3 \
|
2018-11-21 00:01:51 +01:00
|
|
|
yarn \
|
2023-12-23 21:45:09 +01:00
|
|
|
https://github.com/kha7iq/subvars/releases/download/v0.1.5/subvars_${arch}.rpm \
|
2018-11-21 00:01:51 +01:00
|
|
|
&& dnf clean all
|
|
|
|
|
|
|
|
RUN mkdir -p /opt/powerdns-admin \
|
2023-12-19 22:20:10 +01:00
|
|
|
&& curl -fsSL https://github.com/PowerDNS-Admin/PowerDNS-Admin/archive/refs/tags/v0.4.1.tar.gz \
|
|
|
|
| tar -xzf - -C /opt/powerdns-admin --strip 1 \
|
|
|
|
&& sed -i \
|
|
|
|
-e '/cffi/d' \
|
|
|
|
-e '/lxml/d' \
|
|
|
|
-e '/mysqlclient/d' \
|
|
|
|
-e '/psycopg2/d' \
|
|
|
|
-e '/python-ldap/d' \
|
|
|
|
-e '/python3-saml/d' \
|
|
|
|
-e '/PyYAML/d' \
|
|
|
|
/opt/powerdns-admin/requirements.txt \
|
2020-01-03 17:52:23 +01:00
|
|
|
&& chown -R root: /opt/powerdns-admin
|
2018-11-21 00:01:51 +01:00
|
|
|
|
|
|
|
WORKDIR /opt/powerdns-admin
|
|
|
|
|
2023-12-20 15:10:14 +01:00
|
|
|
RUN pip3 install -r requirements.txt --no-cache-dir
|
2018-11-21 00:01:51 +01:00
|
|
|
|
2020-01-08 01:07:16 +01:00
|
|
|
ENV FLASK_APP=/opt/powerdns-admin/powerdnsadmin/__init__.py
|
2024-01-01 20:39:33 +01:00
|
|
|
ENV SSL_MAIN_DOMAIN=""
|
|
|
|
ENV SSL_EXTRA_DOMAINS=""
|
2018-11-21 00:01:51 +01:00
|
|
|
|
2024-01-01 20:39:33 +01:00
|
|
|
COPY config.py.tpl Caddyfile.tpl docker-entrypoint.sh /
|
2020-01-08 01:07:16 +01:00
|
|
|
COPY run.py .
|
2024-01-01 20:39:33 +01:00
|
|
|
COPY --chown=uwsgi:uwsgi pdns-admin.ini /etc/uwsgi.ini
|
|
|
|
COPY supervisor.ini /etc/supervisord.d/supervisor.ini
|
2018-11-21 00:01:51 +01:00
|
|
|
|
2023-12-19 18:25:44 +01:00
|
|
|
RUN subvars --prefix 'PDNS_ADMIN_' < /config.py.tpl > /opt/powerdns-admin/config.py \
|
2018-11-21 00:01:51 +01:00
|
|
|
&& sed -i '/SQLALCHEMY_DATABASE_URI/d' /opt/powerdns-admin/config.py
|
|
|
|
|
2020-01-03 17:52:23 +01:00
|
|
|
RUN yarn install --pure-lockfile --production \
|
|
|
|
&& yarn cache clean \
|
2018-11-21 00:01:51 +01:00
|
|
|
&& flask assets build \
|
2023-04-21 17:34:11 +02:00
|
|
|
&& chown -R uwsgi: /opt/powerdns-admin/powerdnsadmin/static/.webassets-cache
|
2024-01-01 20:39:33 +01:00
|
|
|
|
|
|
|
EXPOSE 8080
|
|
|
|
|
2024-01-03 22:28:50 +01:00
|
|
|
HEALTHCHECK --interval=10s --timeout=10s --retries=3 --start-period=6s \
|
|
|
|
CMD ["curl", "-fsSL", "http://127.0.0.1:8080"]
|
|
|
|
|
2024-01-01 20:39:33 +01:00
|
|
|
ENTRYPOINT [ "/docker-entrypoint.sh" ]
|
|
|
|
|
|
|
|
CMD [ "/usr/bin/supervisord", "-c", "/etc/supervisord.conf" ]
|