-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (33 loc) · 1.28 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 prestashop/prestashop
# Override prestshop/base variables' values
ENV PSS_CONFIGURATION_FILE=/var/www/html/app/config/parameters.php \
DBS_SERVER=biznes-db \
DBS_NAME=db_11 \
DBS_PORT='' \
DBS_PREFIX=ps_ \
DBS_USER=user_11 \
DBS_PASSWD=root \
PSS_DOMAIN=localhost
RUN rm -rf /var/www/html/install/
# Copy files of prestashop
COPY ./html /var/www/html
RUN chown -R www-data:www-data /var/www/html && \
chmod -R 755 /var/www/html
# Update parameters
RUN sed -i "s|'biznes-db'|'${DBS_SERVER}'|g" ${PSS_CONFIGURATION_FILE}
RUN sed -i "s|''|'${DBS_PORT}'|g" ${PSS_CONFIGURATION_FILE}
RUN sed -i "s|'database_user' => 'root'|'database_user' => '${DBS_USER}'|g" ${PSS_CONFIGURATION_FILE}
RUN sed -i "s|'database_password' => 'admin'|'database_password' => '${DBS_PASSWD}'|g" ${PSS_CONFIGURATION_FILE}
RUN sed -i "s|'prestashop'|'${DBS_NAME}'|g" ${PSS_CONFIGURATION_FILE}
RUN sed -i "s|'ps_'|'${DBS_PREFIX}'|g" ${PSS_CONFIGURATION_FILE}
# Create SSL cert and copy apache2 configuration
RUN mkdir /scripts
COPY ./scripts/handle_ssl_cert.sh /scripts/handle_ssl_cert.sh
RUN /scripts/handle_ssl_cert.sh
COPY ./server_conf/000-default.conf /etc/apache2/sites-available/000-default.conf
# Enable apache2 modules
RUN a2enmod ssl headers
# Set default directory
WORKDIR /var/www/html
# Expose ports
EXPOSE 80 443