-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
54 lines (37 loc) · 1.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
FROM phusion/passenger-customizable:0.9.18
MAINTAINER Mike O'Connor <moconnore@gmail.com>
# Set correct environment variables.
ENV HOME /root
# Use baseimage-docker's init process.
CMD ["/sbin/my_init"]
# Build system and git.
RUN /pd_build/utilities.sh
# Python support.
RUN /pd_build/python.sh
RUN apt-get update && apt-get install -y sqlite3 bind9 dnsutils git python-pip python-dev build-essential autoconf libffi-dev libssl-dev nano
ENV TERM=xterm
#setup app
ADD ddns/app/requirements.txt /home/ddns/app/
RUN pip install -r /home/ddns/app/requirements.txt
ADD ddns/app/__init__.py /home/ddns/app/
ADD ddns/app/api.py /home/ddns/app/
ADD ddns/app/le.py /home/ddns/app/
ADD ddns/app/ddns.py /home/ddns/app/
ADD ddns/app/db.py /home/ddns/app/
ADD ddns/passenger_wsgi.py /home/ddns/
#enable nginx for wsgi
RUN rm -f /etc/service/nginx/down
#remove default site
RUN rm /etc/nginx/sites-enabled/default
#add web conf
ADD ddns/api_nginx.conf /etc/nginx/sites-enabled/
#preserve DDNS variable in nginx
RUN echo "env DDNS;" > /etc/nginx/main.d/ddns.conf
#Copy files in docker container
RUN install -d -o bind -g bind -m 755 /var/run/named
#run install script
COPY ./install.sh /
RUN chmod +x /install.sh; sync && /install.sh && rm /install.sh
EXPOSE 5000 53 953 53/udp
# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*