forked from lhalam/EcoMap
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
55 lines (45 loc) · 1.46 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
FROM ubuntu
RUN echo debconf debconf/frontend select Noninteractive | debconf-set-selections
RUN apt-get update && apt-get install -y \
apache2 \
git \
libapache2-mod-wsgi \
libffi-dev \
libmysqlclient-dev \
libssl-dev \
libxml2-dev \
libxslt1-dev \
memcached \
mysql-client \
python-dev \
python-pip \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN echo "[client]" >> /etc/mysql/conf.d/mysql.cnf
RUN echo "protocol=tcp" >> /etc/mysql/conf.d/mysql.cnf
RUN echo "default-character-set = utf8" >> /etc/mysql/conf.d/mysql.cnf
COPY ecomap /opt/ecomap
# COPY requirements.txt /tmp/
RUN pip install --upgrade pip
# RUN pip install -r /tmp/requirements.txt
# Maybe not correct, but will work for current educational project purpose
RUN pip install -r /opt/ecomap/requirements.txt
ENV PRODROOT=/opt/ecomap
ENV PYSRCROOT=${PRODROOT}/src/python
ENV CONFROOT=${PRODROOT}/etc
ENV PYTHONPATH=${PRODROOT}/src/python
ENV PYTHON=/etc/python
ENV PYTHON_EGG_CACHE=/tmp/.python-eggs
ENV STATICROOT=${PRODROOT}/www/
RUN a2enmod wsgi
COPY ecomap/etc/_ecomap_apache.conf /etc/apache2/sites-available/ecomap.conf
RUN a2ensite ecomap
RUN a2dissite 000-default
RUN echo "ServerName localhost" >> /etc/apache2/conf-available/fqdn.conf
RUN a2enconf fqdn
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_PID_FILE /var/run/apache2.pid
ENV APACHE_LOCK_DIR /var/run
CMD ["/opt/ecomap/bin/db_deploy_and_run.sh"]
EXPOSE 80