├── .dockerignore
├── .gitignore
├── .gitattributes
├── container
└── apache
│ ├── entrypoint.d
│ ├── 030-migrations.sh
│ ├── 010-oxid.sh
│ └── 020-demodata.sh
│ ├── files
│ ├── entrypoint.sh
│ ├── 000-default.conf
│ └── config.inc.php
│ └── Dockerfile
├── .env
├── docker-compose.yml
└── README.md
/.dockerignore:
--------------------------------------------------------------------------------
1 | /data
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /data
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto eol=lf
--------------------------------------------------------------------------------
/container/apache/entrypoint.d/030-migrations.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | set -e
3 |
4 | vendor/bin/oe-eshop-db_migrate migrations:migrate
--------------------------------------------------------------------------------
/container/apache/files/entrypoint.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | set -e
3 |
4 | DIR=/entrypoint.d
5 | if [[ -d "$DIR" ]]
6 | then
7 | /bin/run-parts --verbose --regex '\.sh$' "$DIR"
8 | fi
9 |
10 | exec "$@"
--------------------------------------------------------------------------------
/.env:
--------------------------------------------------------------------------------
1 | DOMAIN=oxid6.localhost
2 |
3 | OXID_VERSION=dev-b-6.4-ce
4 | OXID_DEMODATA=true
5 |
6 | APACHE_PORT=80
7 | APACHE_HTTPS_PORT=443
8 | MAILHOG_PORT=8025
9 | PHPMYADMIN_PORT=8080
10 |
11 | MYSQL_DATABASE=oxid6
12 | MYSQL_USER=oxid6
13 | MYSQL_PASSWORD=UX6rg8AsaiR2
14 | MYSQL_ROOT_PASSWORD=DaZs82An!Hd3q#3uqdqB
15 |
--------------------------------------------------------------------------------
/container/apache/entrypoint.d/010-oxid.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | set -e
3 |
4 | # bootstrap oxid files/project
5 | if [ ! -f /var/www/html/source/config.inc.php ]
6 | then
7 | COMPOSER_MEMORY_LIMIT=-1 composer create-project --keep-vcs oxid-esales/oxideshop-project . ${OXID_VERSION}
8 | mv /var/www/config.inc.php /var/www/html/source/config.inc.php
9 | chown -R www-data:www-data /var/www/html/source/
10 | echo "#####################################"
11 | echo "##### OXID bootstrap completed! #####"
12 | echo "#####################################"
13 | fi
14 |
--------------------------------------------------------------------------------
/container/apache/entrypoint.d/020-demodata.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | set -e
3 |
4 | INSTALL_DEMODATA=${OXID_DEMODATA}
5 |
6 | # bootstrap oxid database/demodata
7 | MYSQL_CHECKDATA=`mysql -h oxid6_mysql -u ${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE} --skip-column-names -e "SHOW TABLES FROM ${MYSQL_DATABASE} LIKE 'oxconfig';"`
8 | if [ "${MYSQL_CHECKDATA}" = "" ]
9 | then
10 | mysql -h oxid6_mysql -u ${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE} < /var/www/html/source/Setup/Sql/database_schema.sql
11 | mysql -h oxid6_mysql -u ${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE} -e "UPDATE oxshops SET OXSMTP = 'mail.server:1025', OXSMTPUSER = '', OXSMTPPWD = '' WHERE oxid = 1;"
12 | if [ "${INSTALL_DEMODATA}" = true ]
13 | then
14 | mysql -h oxid6_mysql -u ${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE} < /var/www/html/vendor/oxid-esales/oxideshop-demodata-ce/src/demodata.sql
15 | rm -rf /var/www/html/source/Setup/
16 | fi
17 | /var/www/html/vendor/bin/oe-eshop-db_views_regenerate
18 | fi
19 |
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3'
2 |
3 | services:
4 |
5 | oxid6_apache:
6 | build: container/apache/.
7 | hostname: ${DOMAIN}
8 | restart: always
9 | depends_on:
10 | - oxid6_mysql
11 | volumes:
12 | - ./data/www/:/var/www/html/:cached
13 | environment:
14 | DOMAIN: ${DOMAIN}
15 | APACHE_PORT: ${APACHE_PORT}
16 | OXID_VERSION: ${OXID_VERSION}
17 | OXID_DEMODATA: ${OXID_DEMODATA}
18 | MYSQL_DATABASE: ${MYSQL_DATABASE}
19 | MYSQL_USER: ${MYSQL_USER}
20 | MYSQL_PASSWORD: ${MYSQL_PASSWORD}
21 | ports:
22 | - ${APACHE_PORT}:80
23 | - ${APACHE_HTTPS_PORT}:443
24 | links:
25 | - oxid6_mailhog:mail.server
26 |
27 | oxid6_mysql:
28 | platform: 'linux/x86_64'
29 | image: mysql:5.7
30 | hostname: mysql.${DOMAIN}
31 | restart: always
32 | volumes:
33 | - ./data/mysql/:/var/lib/mysql
34 | environment:
35 | MYSQL_DATABASE: ${MYSQL_DATABASE}
36 | MYSQL_USER: ${MYSQL_USER}
37 | MYSQL_PASSWORD: ${MYSQL_PASSWORD}
38 | MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
39 |
40 | oxid6_mailhog:
41 | hostname: mailhog.${DOMAIN}
42 | image: mailhog/mailhog:latest
43 | ports:
44 | - ${MAILHOG_PORT}:8025
45 |
46 | oxid6_phpmyadmin:
47 | image: phpmyadmin/phpmyadmin:latest
48 | ports:
49 | - ${PHPMYADMIN_PORT}:80
50 | environment:
51 | PMA_HOST: oxid6_mysql
52 |
--------------------------------------------------------------------------------
/container/apache/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM php:8.0-apache
2 |
3 | MAINTAINER module@proudcommerce.com
4 |
5 | # timezone / date
6 | RUN echo "Europe/Berlin" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata
7 |
8 | # install packages
9 | RUN apt-get update -y && \
10 | apt-get install -y --no-install-recommends \
11 | less vim wget unzip rsync git default-mysql-client libzip-dev ssl-cert \
12 | libcurl4-openssl-dev libfreetype6 libjpeg62-turbo libpng-dev libjpeg-dev libxml2-dev libxpm4 && \
13 | apt-get clean && \
14 | apt-get autoremove -y && \
15 | rm -rf /var/lib/apt/lists/* && \
16 | echo "export TERM=xterm" >> /root/.bashrc
17 |
18 | # install php extensions
19 | RUN docker-php-ext-configure gd --with-jpeg && \
20 | docker-php-ext-install -j$(nproc) zip bcmath soap pdo_mysql gd
21 |
22 | # composer stuff
23 | RUN php -r 'readfile("https://getcomposer.org/installer");' > composer-setup.php \
24 | && php composer-setup.php --install-dir=/usr/local/bin --filename=composer \
25 | && rm -f composer-setup.php \
26 | && chown www-data:www-data /var/www
27 |
28 | # prepare entrypoint.d pattern
29 | RUN mkdir /entrypoint.d
30 | COPY ./files/entrypoint.sh /entrypoint.sh
31 | COPY ./entrypoint.d/* /entrypoint.d/
32 | RUN chmod 777 /entrypoint.sh && chmod 777 /entrypoint.d/*
33 |
34 | # apache stuff
35 | RUN /usr/sbin/a2enmod rewrite && /usr/sbin/a2enmod headers && /usr/sbin/a2enmod expires && /usr/sbin/a2enmod ssl
36 | COPY ./files/000-default.conf /etc/apache2/sites-available/000-default.conf
37 |
38 | # oxid stuff
39 | COPY ./files/config.inc.php /var/www/config.inc.php
40 |
41 | ENTRYPOINT ["/entrypoint.sh"]
42 | CMD ["apache2-foreground"]
43 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Docker OXID eShop 6
2 |
3 | This (linux/osx) setup bootstraps an dockerized developer environment for [OXID eShop 6](https://github.com/OXID-eSales/oxideshop_ce).
4 |
5 | **For OXID 7 have a look [here](https://github.com/proudcommerce/docker-oxid7).**
6 |
7 |
8 | ## Overview
9 |
10 | - Apache 2.4 container PHP 8.0 ([Dockerfile](container/apache/Dockerfile))
11 | - MySQL 5.7 container ([Dockerfile](https://github.com/docker-library/mysql/blob/883703dfb30d9c197e0059a669c4bb64d55f6e0d/5.7/Dockerfile))
12 | - MailHog container ([Dockerfile](https://github.com/mailhog/MailHog/blob/master/Dockerfile))
13 | - phpMyAdmin container ([Dockerfile](https://hub.docker.com/r/phpmyadmin/phpmyadmin/~/dockerfile/))
14 | - OXID eShop ([latest 6.4.x](https://github.com/OXID-eSales/oxideshop_metapackage_ce/blob/b-6.4/composer.json))
15 | - OXID demo data
16 |
17 | ## Quickstart
18 | 1. Install [docker engine](https://docs.docker.com/engine/installation/)
19 | 2. Add `127.0.0.1 oxid6.localhost` to your etc/hosts file (if needed eg. windows)
20 | 3. Fire up container
21 | ```bash
22 | # clone repository:
23 | git clone https://github.com/proudcommerce/docker-oxid6.git docker_oxid6
24 | cd docker_oxid6
25 | # create container
26 | docker-compose build
27 | # fire up container
28 | docker-compose up
29 | ```
30 | ## Configuration
31 |
32 | ### Installation
33 | - Creating oxid project takes round about 5 minutes. It´s finished when docker log shows `OXID bootstrap completed!`).
34 | - Shop: `http://oxid6.localhost` (or `https://oxid6.localhost` with ssl-cert-snakeoil)
35 | - Shop admin `http://oxid6.localhost/admin/`, credentials: `admin / admin`
36 | - MailHog: `http://oxid6.localhost:8025`
37 | - phpMyAdmin: `http://oxid6.localhost:8080`
38 |
39 | ### Container
40 | - If you would like to run container in background, use `docker-compose up -d` for starting container and `docker logs -f oxid6_apache` for log information (eg. composer information).
41 |
42 | ### Data
43 | - Data (`www` and `mysql`) is storend on host: `data` directory
44 |
45 | ### Credentials
46 | - You can change all credentials (domain, ports, database, ...) in `.env` file.
47 |
48 | ### OXID demo data
49 | - Normally oxid demo data will be installed automatically.
50 | - If you need a project without demo data, set `OXID_DEMODATA=false` in `.env` file.
51 |
52 | ## Support
53 |
54 | [https://forum.oxid-esales.com/t/docker-container-fur-oxid-6/92282](https://forum.oxid-esales.com/t/docker-container-fur-oxid-6/92282)
55 |
56 | ## License
57 |
58 | This program is free software: you can redistribute it and/or modify
59 | it under the terms of the GNU General Public License as published by
60 | the Free Software Foundation, either version 3 of the License, or
61 | (at your option) any later version.
62 |
63 | This program is distributed in the hope that it will be useful,
64 | but WITHOUT ANY WARRANTY; without even the implied warranty of
65 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
66 | GNU General Public License for more details.
67 |
68 | You should have received a copy of the GNU General Public License
69 | along with this program. If not, see .
70 |
71 |
72 | ## Copyright
73 |
74 | ProudCommerce | 2020 | proudcommerce.com
75 |
--------------------------------------------------------------------------------
/container/apache/files/000-default.conf:
--------------------------------------------------------------------------------
1 |
2 | # The ServerName directive sets the request scheme, hostname and port that
3 | # the server uses to identify itself. This is used when creating
4 | # redirection URLs. In the context of virtual hosts, the ServerName
5 | # specifies what hostname must appear in the request's Host: header to
6 | # match this virtual host. For the default virtual host (this file) this
7 | # value is not decisive as it is used as a last resort host regardless.
8 | # However, you must set it for any further virtual host explicitly.
9 | #ServerName www.example.com
10 |
11 | ServerAdmin webmaster
12 | DocumentRoot /var/www/html/source
13 | ServerSignature Off
14 |
15 |
16 | Options -Indexes -FollowSymLinks -MultiViews
17 | AllowOverride all
18 | Order allow,deny
19 | Allow from all
20 |
21 |
22 | # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
23 | # error, crit, alert, emerg.
24 | # It is also possible to configure the loglevel for particular
25 | # modules, e.g.
26 | #LogLevel info ssl:warn
27 |
28 | ErrorLog ${APACHE_LOG_DIR}/error.log
29 | CustomLog ${APACHE_LOG_DIR}/access.log combined
30 |
31 | # For most configuration files from conf-available/, which are
32 | # enabled or disabled at a global level, it is possible to
33 | # include a line for only one particular virtual host. For example the
34 | # following line enables the CGI configuration for this host only
35 | # after it has been globally disabled with "a2disconf".
36 | #Include conf-available/serve-cgi-bin.conf
37 |
38 |
39 | # The ServerName directive sets the request scheme, hostname and port that
40 | # the server uses to identify itself. This is used when creating
41 | # redirection URLs. In the context of virtual hosts, the ServerName
42 | # specifies what hostname must appear in the request's Host: header to
43 | # match this virtual host. For the default virtual host (this file) this
44 | # value is not decisive as it is used as a last resort host regardless.
45 | # However, you must set it for any further virtual host explicitly.
46 | #ServerName www.example.com
47 |
48 | ServerAdmin webmaster
49 | DocumentRoot /var/www/html/source
50 |
51 | SSLEngine on
52 | SSLCertificateFile "/etc/ssl/certs/ssl-cert-snakeoil.pem"
53 | SSLCertificateKeyFile "/etc/ssl/private/ssl-cert-snakeoil.key"
54 |
55 | ServerSignature Off
56 |
57 |
58 | Options -Indexes -FollowSymLinks -MultiViews
59 | AllowOverride all
60 | Order allow,deny
61 | Allow from all
62 |
63 |
64 | # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
65 | # error, crit, alert, emerg.
66 | # It is also possible to configure the loglevel for particular
67 | # modules, e.g.
68 | #LogLevel info ssl:warn
69 |
70 | ErrorLog ${APACHE_LOG_DIR}/error.log
71 | CustomLog ${APACHE_LOG_DIR}/access.log combined
72 |
73 | # For most configuration files from conf-available/, which are
74 | # enabled or disabled at a global level, it is possible to
75 | # include a line for only one particular virtual host. For example the
76 | # following line enables the CGI configuration for this host only
77 | # after it has been globally disabled with "a2disconf".
78 | #Include conf-available/serve-cgi-bin.conf
79 |
80 |
--------------------------------------------------------------------------------
/container/apache/files/config.inc.php:
--------------------------------------------------------------------------------
1 | .
17 | *
18 | * @link http://www.oxid-esales.com
19 | * @copyright (C) OXID eSales AG 2003-2016
20 | * @version OXID eShop CE
21 | */
22 |
23 | // Database connection information
24 | $this->dbType = 'pdo_mysql';
25 | $this->dbHost = 'oxid6_mysql'; // database host name
26 | $this->dbPort = 3306; // tcp port to which the database is bound
27 | $this->dbName = \getenv('MYSQL_DATABASE'); // database name
28 | $this->dbUser = \getenv('MYSQL_USER'); // database user name
29 | $this->dbPwd = \getenv('MYSQL_PASSWORD'); // database user password
30 | $this->sShopURL = 'http://'.\getenv('DOMAIN').':'.\getenv('APACHE_PORT'); // eShop base url, required
31 | $this->sSSLShopURL = 'https://'.\getenv('DOMAIN').':'.\getenv('APACHE_HTTPS_PORT'); // eShop SSL url, optional
32 | $this->sAdminSSLURL = 'https://'.\getenv('DOMAIN').':'.\getenv('APACHE_HTTPS_PORT').'/admin'; // eShop Admin SSL url, optional
33 | $this->sShopDir = '/var/www/html/source';
34 | $this->sCompileDir = '/var/www/html/source/tmp';
35 |
36 | /**
37 | * Force shop edition. Even if enterprise or professional packages exists, shop edition can still be forced here.
38 | * Possible options: CE|PE|EE or left empty (will be determined automatically).
39 | */
40 | $this->edition = '';
41 |
42 | // File type whitelist for file upload
43 | $this->aAllowedUploadTypes = array('jpg', 'gif', 'png', 'pdf', 'mp3', 'avi', 'mpg', 'mpeg', 'doc', 'xls', 'ppt');
44 |
45 | // Timezone information
46 | date_default_timezone_set('Europe/Berlin');
47 |
48 | /**
49 | * Search engine friendly URL processor.
50 | * After changing this value, you should rename oxid.php file as well
51 | * Always leave .php extension here unless you know what you are doing
52 | */
53 | $this->sOXIDPHP = "oxid.php";
54 |
55 | /**
56 | * Enable debug mode for template development or bugfixing
57 | * -1 = Log more messages and throw exceptions on errors (not recommended for production)
58 | * 0 = off
59 | * 1 = smarty
60 | * 3 = smarty
61 | * 4 = smarty + shoptemplate data
62 | * 5 = Delivery Cost calculation info
63 | * 6 = SMTP Debug Messages
64 | * 8 = display smarty template names (requires /tmp cleanup)
65 | */
66 | $this->iDebug = 0;
67 |
68 | // Log all modifications performed in Admin
69 | $this->blLogChangesInAdmin = false;
70 |
71 | // Force admin email. Offline warnings are sent with high priority to this address.
72 | $this->sAdminEmail = '';
73 |
74 | // Defines the time interval in seconds warnings are sent during the shop is offline.
75 | $this->offlineWarningInterval = 60 * 5;
76 |
77 | // In case session must be started on the very first user page visit (not only on session required action).
78 | $this->blForceSessionStart = false;
79 |
80 | // Use browser cookies to store session id (no sid parameter in URL)
81 | $this->blSessionUseCookies = true;
82 |
83 | /**
84 | * The domain that the cookie is available: array(_SHOP_ID_ => _DOMAIN_);
85 | * Check setcookie() documentation for more details: http://php.net/manual/de/function.setcookie.php
86 | */
87 | $this->aCookieDomains = null;
88 |
89 | /**
90 | * The path on the server in which the cookie will be available on: array(_SHOP_ID_ => _PATH_);
91 | * Check setcookie() documentation for more details: http://php.net/manual/de/function.setcookie.php
92 | */
93 | $this->aCookiePaths = null;
94 |
95 | // List of all Search-Engine Robots
96 | $this->aRobots = array(
97 | 'googlebot',
98 | 'ultraseek',
99 | 'crawl',
100 | 'spider',
101 | 'fireball',
102 | 'robot',
103 | 'slurp',
104 | 'fast',
105 | 'altavista',
106 | 'teoma',
107 | 'msnbot',
108 | 'bingbot',
109 | 'yandex',
110 | 'gigabot',
111 | 'scrubby'
112 | );
113 |
114 | // Deactivate Static URL's for these Robots
115 | $this->aRobotsExcept = array();
116 |
117 | // IP addresses for which session/cookie id match and user agent change checks are off
118 | $this->aTrustedIPs = array();
119 |
120 | /**
121 | * Works only if basket reservations feature is enabled in admin.
122 | *
123 | * The number specifies how many expired basket reservations are
124 | * cleaned per one request (to the eShop).
125 | * Cleaning a reservation basically means returning the reserved
126 | * stock to the articles.
127 | *
128 | * Keeping this number too low may cause article stock being returned too
129 | * slowly, while too high value may have spiking impact on the performance.
130 | */
131 | $this->iBasketReservationCleanPerRequest = 200;
132 |
133 | /**
134 | * Should template blocks be highlighted in frontend?
135 | * This is mainly intended for module writers in non productive environment
136 | */
137 | $this->blDebugTemplateBlocks = false;
138 |
139 | /**
140 | * Should requests, coming via stdurl and not redirected to seo url be logged to seologs db table?
141 | * Note: only active if in productive mode, as the eShop in non productive more will always log such urls
142 | */
143 | $this->blSeoLogging = false;
144 |
145 | /**
146 | * To override FrontendController::$_aUserComponentNames use this array option:
147 | * array keys are component(class) names and array values defines if component is cacheable (true/false)
148 | * E.g. array('user_class' => false);
149 | */
150 | $this->aUserComponentNames = null;
151 |
152 | // Additional multi language tables
153 | $this->aMultiLangTables = null;
154 |
155 | // Instructs shop that price update is performed by cron (time based job sheduler)
156 | $this->blUseCron = false;
157 |
158 | // Do not disable module if class from extension path does not exist.
159 | $this->blDoNotDisableModuleOnError = false;
160 |
161 | // Enable temporarily in case you can't access the backend due to broken views
162 | $this->blSkipViewUsage = false;
163 |
164 | /**
165 | * Enterprise Edition related config options.
166 | * This options have no effect on Community/Professional Editions.
167 | */
168 |
169 | //Time limit in ms to be notified about slow queries
170 | $this->iDebugSlowQueryTime = 20;
171 |
172 | /**
173 | * Enables Rights and Roles engine
174 | * 0 - off,
175 | * 1 - only in admin,
176 | * 2 - only in shop,
177 | * 3 - both
178 | */
179 | $this->blUseRightsRoles = 3;
180 |
181 | /**
182 | * Define oxarticles fields which could be edited individually in subshops.
183 | * Do not forget to add these fields to oxfield2shop table.
184 | * Note: The field names are case sensitive here.
185 | */
186 | $this->aMultishopArticleFields = array("OXPRICE", "OXPRICEA", "OXPRICEB", "OXPRICEC", "OXUPDATEPRICE", "OXUPDATEPRICEA", "OXUPDATEPRICEB", "OXUPDATEPRICEC", "OXUPDATEPRICETIME");
187 |
188 | // Show "Update Views" button in admin
189 | $this->blShowUpdateViews = true;
190 |
191 | // If default 30 seconds is not enougth
192 | // @set_time_limit(3000);
193 |
194 | /**
195 | * Database master-slave configuration:
196 | * aSlaveHosts - array of slave hosts: array('localhost', '10.2.3.12')
197 | */
198 | $this->aSlaveHosts = null;
199 |
200 | // Control the removal of Setup directory
201 | $this->blDelSetupDir = true;
202 |
203 | /**
204 | * Needed for backwards compatibility. Do not change the value of this property.
205 | *
206 | * @deprecated since v6.0 (2017-05-15); This property will be removed in the future as the shop will always use UTF-8.
207 | */
208 | $this->iUtfMode = 1;
209 |
--------------------------------------------------------------------------------