-
Notifications
You must be signed in to change notification settings - Fork 2
/
Zip_Dockerfile.twig
68 lines (47 loc) · 2.38 KB
/
Zip_Dockerfile.twig
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
{% set shopwareVersion = imageName|split('_')[1] %}
{% set shopwareUrl = imageName|split('_').slice(2, 5).join('_') %}
{% set mysqlVersion = imageName|split('_')[5] %}
{% set phpVersion = imageName|split('_')[6] %}
{% set consentManagerVersion = imageName|split('_')[7] %}
{% set consentManagerRequired = consentManagerVersion != 'none' %}
# Check out shopware source
FROM alpine/git:latest AS clone
RUN wget --header="User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/600.1.17 (KHTML, like Gecko)a Version/8.0 Safari/600.1.17" https://releases.shopware.com/{{ shopwareUrl }}.zip -O install.zip && unzip install.zip -d /shopware
RUN cd /shopware
{% if consentManagerRequired %}
RUN cd /shopware/custom/plugins && \
git clone https://github.com/shopware5/SwagCookieConsentManager.git SwagCookieConsentManager --depth=1 --branch={{ consentManagerVersion }}
{% endif %}
# Inherit files, install NodeJS-dependencies
FROM node:10 AS js-deps
COPY --from="clone" /shopware /shopware
WORKDIR /shopware
RUN npm install --prefix ./themes && \
npm install --prefix ./themes/Frontend/Resposnsive && \
touch .make.install.npm-dependencies
FROM ghcr.io/shopware5/docker-images-testing/running:shopware_{{ shopwareVersion }}_{{ mysqlVersion }}_{{ phpVersion }}
COPY --from="js-deps" /shopware /shopware
COPY start-mysql.sh /shopware/start-mysql.sh
WORKDIR /shopware
ENV COMPOSER_ALLOW_SUPERUSER=1
ENV DB_USER=root
ENV DB_PORT=3306
ENV DB_NAME=shopware
ENV DB_HOST=127.0.0.1
ENV DB_PASSWORD=root
ENV SW_HOST=localhost
ENV SW_BASE_PATH=
RUN ./start-mysql.sh \
&& mysqladmin --user=root password 'root'
RUN ./start-mysql.sh \
&& mysql -e "CREATE DATABASE shopware" \
&& php recovery/install/index.php --db-port=${DB_PORT} --db-user=${DB_USER} --db-password=${DB_PASSWORD} --db-name=${DB_NAME} --shop-name=Demo --shop-host=${SW_HOST} --shop-path=${SW_BASE_PATH} --shop-locale=en_GB --admin-locale=en_GB --shop-currency=EUR --admin-username=demo --admin-password=demo --admin-name=Demo --admin-email=demo@demo.de --no-interaction
{% if consentManagerRequired %}
RUN ./start-mysql.sh \
&& php bin/console sw:plugin:refresh \
&& php bin/console sw:plugin:install SwagCookieConsentManager
{% endif %}
COPY --chown="root:root" entrypoint.sh /entrypoint.sh
RUN chown -R www-data:www-data /shopware
ENTRYPOINT ["bash", "-c", "/entrypoint.sh"]
{#RUN php bin/console sw:cache:clear#}