-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathDockerfile
41 lines (36 loc) · 1.92 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
FROM debian:oldoldstable
ENV SERVERNAME=geti2p.net
WORKDIR /var/www/i2p.www
## Install the dependencies
#RUN #grep -v security.debian /etc/apt/sources.list > /etc/apt/sources.list.bak && \
#grep -v stretch-updates /etc/apt/sources.list.bak > /etc/apt/sources.list && \
RUN apt-get update && \
apt-get -y install apache2 apache2-utils libapache2-mod-wsgi python2-dev python-pip patch python-virtualenv git python-polib
ADD . /var/www/i2p.www
## Start setting up the site
RUN rm -rfv env && \
virtualenv --distribute env && \
. env/bin/activate && \
pip install -r etc/reqs.txt && \
patch -p0 -N -r - <etc/multi-domain.patch && \
cp -rv env ../env && \
./compile-messages.sh && \
echo "Git revision: $(git log -n 1 | grep commit | sed 's/commit //' | sed 's/ .*$//')" | tee ./i2p2www/pages/include/mtnversion && \
## We've now updated the site
## Next let's configure WSGI
## Set ownership of site to server
cp etc/docker.wsgi.i2p i2p.wsgi && \
chown -R www-data /var/www/i2p.www && \
## Make the WSGI script owned by the server
chown www-data:www-data /var/www/i2p.www/i2p.wsgi && \
## Make the WSGI script executable
chmod 755 /var/www/i2p.www/i2p.wsgi && \
## Copy the unmodified vhosts file to the apache2 confdir
cp etc/apache2.i2p.conf /etc/apache2/sites-available/i2p.conf && \
a2enmod wsgi && \
a2ensite i2p && \
ls /etc/apache2 && \
sed -i 's|IncludeOptional sites-enabled|# IncludeOptional sites-enabled|g' /etc/apache2/apache2.conf && \
sed -i '1 i\IncludeOptional sites-enabled/i2p.conf' /etc/apache2/apache2.conf
CMD service apache2 restart && tail -f /var/log/apache2/access.log /var/log/apache2/error.log