-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
84 lines (68 loc) · 2.6 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
FROM php:5.6-apache
MAINTAINER Kermit
ENV PS_VERSION 1.6.1.4
ENV PS_URL https://www.prestashop.com/ajax/controller.php?method=download&type=releases&file=prestashop_1.6.1.4.zip&language=fr
ENV PS_DOMAIN prestashop.local
ENV PS_LANGUAGE en
ENV PS_COUNTRY gb
ENV PS_INSTALL_AUTO 0
ENV PS_DEV_MODE 0
ENV PS_HOST_MODE 0
ENV PS_HANDLE_DYNAMIC_DOMAIN 0
ENV PS_FOLDER_ADMIN admin
ENV PS_FOLDER_INSTALL install
# needed for Apache2 under Ubuntu
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/apache2.pid
ENV APACHE_RUN_DIR /var/run/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2
# Avoid MySQL questions during installation
ENV DEBIAN_FRONTEND noninteractive
RUN echo mysql-server-5.6 mysql-server/root_password password $DB_PASSWD | debconf-set-selections
RUN echo mysql-server-5.6 mysql-server/root_password_again password $DB_PASSWD | debconf-set-selections
RUN apt-get update \
&& apt-get install -y libmcrypt-dev \
libjpeg62-turbo-dev \
libpng12-dev \
libfreetype6-dev \
libxml2-dev \
mysql-client \
mysql-server \
wget \
unzip \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install iconv mcrypt pdo mysql pdo_mysql mbstring soap gd
# Get PrestaShop
ADD $PS_URL /tmp/prestashop.zip
RUN unzip -q /tmp/prestashop.zip -d /tmp/ && mv /tmp/prestashop/* /var/www/html && rm /tmp/prestashop.zip
COPY config_files/docker_updt_ps_domains.php /var/www/html/
# Apache configuration
RUN a2enmod rewrite
RUN chmod -R a+rwx /var/www/html/
RUN sed -e 's/Listen 80/Listen 8080/' -i /etc/apache2/apache2.conf /etc/apache2/ports.conf \
&& sed -i 's/ErrorLog .*/ErrorLog \/var\/log\/apache2\/error.log/' /etc/apache2/apache2.conf \
&& sed -i 's/CustomLog .*/CustomLog \/var\/log\/apache2\/custom.log combined/' /etc/apache2/apache2.conf \
&& sed -i 's/LogLevel .*/LogLevel info/' /etc/apache2/apache2.conf \
&& touch /var\/log\/apache2\/error.log \
&& touch \/var\/log\/apache2\/custom.log \
&& chmod -R a+rwx /var/log/apache2 \
&& chmod -R a+rwx /var/lock/apache2 \
&& chmod -R a+rwx /var/run/apache2
# PHP configuration
COPY config_files/php.ini /usr/local/etc/php/
# needed for Apache2 under Ubuntu
RUN mkdir -p $APACHE_RUN_DIR $APACHE_LOCK_DIR $APACHE_LOG_DIR
# Expose 8080 because 80 is allowed only for root
EXPOSE 8080
#Volumes
VOLUME /var/www/html/modules
VOLUME /var/www/html/themes
VOLUME /var/www/html/override
COPY config_files/docker_run.sh /tmp/
RUN chmod +x /tmp/docker_run.sh
#User
USER 1001
ENTRYPOINT ["/tmp/docker_run.sh"]