-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
54 lines (38 loc) · 1.4 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
FROM ubuntu:14.04
MAINTAINER Alexander Steshenko <[email protected]>
LABEL Description="BasicCRM demo application"
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install openssl ca-certificates apache2 -y
RUN echo "ServerName localhost" >> /etc/apache2/conf-available/servername.conf && a2enconf servername
RUN apt-get install -y \
php5 \
php5-gd \
php5-json \
php5-mysql \
php5-xcache \
php5-readline
RUN apt-get install mariadb-common mariadb-server mariadb-client -y
ENV ALLOW_OVERRIDE All
ENV DATE_TIMEZONE UTC
RUN rm /var/www/html/index.html
COPY ./ /var/www/
RUN /bin/sed -i "s/short_open_tag\ \=\ Off/short_open_tag\ \=\ On/g" /etc/php5/apache2/php.ini
RUN a2enmod rewrite
RUN chown -R www-data:www-data /var/www/html
RUN cd /var/www && php composer.phar install
RUN service mysql start && \
mysql -u root -e "CREATE SCHEMA basiccrm" && \
mysql -u root basiccrm < /var/www/data/dump.sql && \
service mysql stop
VOLUME /var/www
VOLUME /var/log/httpd
VOLUME /var/lib/mysql
VOLUME /var/log/mysql
RUN /bin/sed -i 's/AllowOverride\ None/AllowOverride\ All/g' /etc/apache2/apache2.conf
RUN /bin/sed -i "s/\;date\.timezone\ \=/date\.timezone\ \=\ ${DATE_TIMEZONE}/" /etc/php5/apache2/php.ini
RUN /usr/bin/mysqld_safe --timezone=${DATE_TIMEZONE}&
EXPOSE 80
EXPOSE 3306
CMD service mysql start && /usr/sbin/apachectl -DFOREGROUND -k start