-
Notifications
You must be signed in to change notification settings - Fork 2
/
Latest_Dockerfile.twig
69 lines (47 loc) · 2.14 KB
/
Latest_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
69
{% set shopwareVersion = imageName|split('_')[1] %}
{% set mysqlVersion = imageName|split('_')[2] %}
{% set phpVersion = imageName|split('_')[3] %}
{% set consentManagerVersion = imageName|split('_')[4] %}
{% set consentManagerRequired = consentManagerVersion != 'none' %}
# Check out shopware source
FROM alpine/git:latest AS clone
COPY shopware.zip shopware.zip
RUN unzip shopware.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#}