forked from james-stevens/pyrar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
64 lines (49 loc) · 2.16 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
57
58
59
60
61
62
63
64
# (c) Copyright 2019-2022, James Stevens ... see LICENSE for details
# Alternative license arrangements are possible, contact me for more information
FROM alpine:3.16
RUN rmdir /run
RUN ln -s /dev/shm /run
RUN mkdir /run/policy_subst
RUN apk add nginx curl
RUN addgroup nginx daemon
RUN apk add python3 jq py-pip
RUN apk add py3-flask py3-gunicorn py3-xmltodict py3-tz py3-bcrypt tzdata py3-mysqlclient
RUN apk add py3-dnspython py3-dateutil py3-jinja2 py3-yaml py3-requests
RUN pip install apscheduler base58
RUN apk add postfix
COPY basic_start_files/aliases /etc/postfix/aliases
RUN apk add ldns-tools openssl
RUN apk add sysklogd
RUN rm -f /etc/syslogd.conf; ln -s /run/syslogd.conf /etc/syslogd.conf
RUN rm -f /etc/periodic/daily/sysklogd
RUN apk add pdns pdns-backend-mysql
RUN rm -rf /tmp
RUN rmdir /var/lib/nginx/tmp /var/log/nginx
RUN ln -s /dev/shm /tmp
RUN ln -s /dev/shm /var/lib/nginx/tmp
RUN ln -s /dev/shm /var/log/nginx
RUN ln -s /dev/shm /run/nginx
RUN ln -fns /run/nginx.conf /etc/nginx/nginx.conf
RUN ln -fns /run/server.pem /etc/nginx/server.pem
RUN ln -fns /run/inittab /etc/inittab
RUN ln -fns /run/policy_subst/pdns.conf /etc/pdns/pdns.conf
RUN mkdir -m 755 -p /opt/pyrar /opt/pyrar/config /opt/pyrar/pems
COPY pems/myCA.pem /opt/pyrar/pems/myCA.pem
COPY pems/myCA-2.pem /opt/pyrar/pems/myCA-2.pem
RUN mv /opt/pyrar/pems/myCA.pem /opt/pyrar/pems/myCA-2.pem /etc/ssl/private/
RUN cd /etc/ssl/private; cat myCA.pem myCA-2.pem >> /etc/ssl/cert.pem
RUN ln -fns /usr/local/bin/run_actions /etc/periodic/15min/run_actions
RUN ln -fns /usr/local/bin/run_hourly_jobs /etc/periodic/hourly/run_hourly_jobs
RUN ln -fns /usr/local/bin/run_daily_jobs /etc/periodic/daily/run_daily_jobs
RUN ln -fns /usr/local/bin/check_server_pem /etc/periodic/hourly/check_server_pem
COPY emails /opt/pyrar/emails/
COPY etc /opt/pyrar/etc/
COPY policy_subst /opt/pyrar/policy_subst/
COPY bin /usr/local/bin/
COPY python /opt/pyrar/python/
RUN python3 -m compileall /opt/pyrar/python/
RUN ln -fns /opt/pyrar/python/bin/sqlsh.py /usr/bin/sqlsh
RUN ln -fns /opt/pyrar/python/bin/flat.py /usr/bin/flat
COPY admin_htdocs /opt/pyrar/admin_htdocs/
COPY htdocs /opt/pyrar/htdocs/
CMD [ "/usr/local/bin/run_init" ]