├── data ├── mysql │ └── .gitignore ├── elasticsearch │ └── .gitkeep ├── php │ ├── logs │ │ └── .gitignore │ └── profiler │ │ └── .gitignore └── composer │ └── .gitignore ├── containers ├── php │ ├── .gitignore │ ├── custom.ini.dist │ ├── xdebug.ini │ └── Dockerfile ├── httpd │ ├── .gitignore │ ├── Dockerfile │ ├── custom.conf │ ├── project.conf.dist │ └── certs │ │ ├── server.csr │ │ ├── openssl-server.conf │ │ ├── server.key │ │ ├── server.crt │ │ ├── oxid_esales_localhost_ca.crt │ │ ├── openssl-ca.conf │ │ ├── ca.key │ │ └── README.md ├── loadbalancer │ ├── Dockerfile │ └── loadbalancer.conf.dist ├── redis │ ├── redis-session.ini │ └── Dockerfile └── node │ └── Dockerfile ├── docker-compose.yml.dist ├── .gitignore ├── recipes └── default │ └── example │ ├── examples │ ├── composer.json │ ├── index.php │ ├── database_example.php │ └── email_example.php │ └── run.sh ├── services ├── kibana.yml ├── mailpit.yml ├── adminer.yml ├── sphinx.yml ├── apache.yml ├── elasticsearch.yml ├── redis.override.yml ├── node.yml ├── selenium-firefox.yml ├── nginx-rp.yml ├── selenium-chrome.yml ├── selenium-chrome-126.yml ├── selenium-chrome-debug.yml ├── varnish-rp.yml ├── mysql.yml └── php.yml ├── .env.dist ├── Makefile ├── CHANGELOG.md └── README.md /data/mysql/.gitignore: -------------------------------------------------------------------------------- 1 | * -------------------------------------------------------------------------------- /data/elasticsearch/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/php/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * -------------------------------------------------------------------------------- /data/php/profiler/.gitignore: -------------------------------------------------------------------------------- 1 | * -------------------------------------------------------------------------------- /containers/php/.gitignore: -------------------------------------------------------------------------------- 1 | custom.ini -------------------------------------------------------------------------------- /docker-compose.yml.dist: -------------------------------------------------------------------------------- 1 | services: 2 | -------------------------------------------------------------------------------- /containers/httpd/.gitignore: -------------------------------------------------------------------------------- 1 | project.conf -------------------------------------------------------------------------------- /data/composer/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .env 3 | docker-compose.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .env 3 | /docker-compose.yml 4 | /docker-compose.override.yml 5 | -------------------------------------------------------------------------------- /containers/loadbalancer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:mainline-alpine-slim 2 | ADD loadbalancer.conf /etc/nginx/conf.d -------------------------------------------------------------------------------- /containers/redis/redis-session.ini: -------------------------------------------------------------------------------- 1 | session.save_handler = redis 2 | session.save_path = "tcp://redis:6379" 3 | -------------------------------------------------------------------------------- /containers/redis/Dockerfile: -------------------------------------------------------------------------------- 1 | # Optional: Use official Redis image, so Dockerfile is not strictly needed 2 | FROM redis:7 3 | -------------------------------------------------------------------------------- /recipes/default/example/examples/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "root/www", 3 | "require": { 4 | "phpmailer/phpmailer": "^6.3" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /services/kibana.yml: -------------------------------------------------------------------------------- 1 | kibana: 2 | image: kibana:${KIBANA_VERSION} 3 | ports: 4 | - ${PORT_KIBANA}:5601 5 | depends_on: 6 | - elasticsearch 7 | -------------------------------------------------------------------------------- /containers/php/custom.ini.dist: -------------------------------------------------------------------------------- 1 | display_errors = true 2 | error_reporting = E_ALL 3 | error_log = /var/sync/logs/error_log.txt 4 | log_errors = On 5 | user_ini.cache_ttl = 0 -------------------------------------------------------------------------------- /services/mailpit.yml: -------------------------------------------------------------------------------- 1 | mailpit: 2 | image: axllent/mailpit 3 | ports: 4 | - ${PORT_MAILPIT_SMTP}:1025 # smtp server 5 | - ${PORT_MAILPIT_WEBUI}:8025 # web ui 6 | -------------------------------------------------------------------------------- /services/adminer.yml: -------------------------------------------------------------------------------- 1 | adminer: 2 | image: adminer 3 | restart: always 4 | environment: 5 | ADMINER_DEFAULT_SERVER: mysql 6 | ports: 7 | - ${PORT_ADMINER}:8080 8 | -------------------------------------------------------------------------------- /services/sphinx.yml: -------------------------------------------------------------------------------- 1 | sphinx: 2 | image: oxidesales/oxideshop-docker-sphinx 3 | volumes: 4 | - ${DOC_PATH}:/home/${HOST_USER_NAME}/docs:cached 5 | user: ${HOST_USER_ID}:${HOST_GROUP_ID} -------------------------------------------------------------------------------- /recipes/default/example/examples/index.php: -------------------------------------------------------------------------------- 1 | Examples: 2 |
3 |
  • Database connection
  • 4 |
  • Email sending (run composer install first)
  • 5 |
    6 | 7 | -------------------------------------------------------------------------------- /services/apache.yml: -------------------------------------------------------------------------------- 1 | apache: 2 | platform: linux/x86_64 3 | build: 4 | context: containers/httpd 5 | working_dir: /var/www/ 6 | volumes: 7 | - ./source:/var/www:cached 8 | ports: 9 | - ${PORT_SHOP}:80 10 | - ${PORT_SSL_SHOP}:443 11 | -------------------------------------------------------------------------------- /recipes/default/example/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPT_PATH=$(dirname ${BASH_SOURCE[0]}); 4 | ROOT_PATH="$SCRIPT_PATH/../../.."; 5 | 6 | test -d $ROOT_PATH/source || (mkdir -p $ROOT_PATH/source && cp -r $SCRIPT_PATH/examples/* $ROOT_PATH/source/) 7 | 8 | make up 9 | 10 | docker compose exec -T php composer update --no-interaction 11 | 12 | echo "Done!" -------------------------------------------------------------------------------- /services/elasticsearch.yml: -------------------------------------------------------------------------------- 1 | elasticsearch: 2 | platform: linux/x86_64 3 | image: elasticsearch:${ELASTICSEARCH_VERSION} 4 | volumes: 5 | - ./data/elasticsearch:/usr/share/elasticsearch/data:delegated 6 | environment: 7 | - cluster.name=oxid-cluster 8 | - discovery.type=single-node 9 | ports: 10 | - ${PORT_ELASTIC_SEARCH}:9200 11 | -------------------------------------------------------------------------------- /services/redis.override.yml: -------------------------------------------------------------------------------- 1 | services: 2 | redis: 3 | build: 4 | context: containers/redis 5 | ports: 6 | - "6379:6379" 7 | depends_on: 8 | - php 9 | 10 | php: 11 | build: 12 | args: 13 | INSTALL_REDIS_EXTENSION: "true" 14 | volumes: 15 | - ./containers/redis/redis-session.ini:/usr/local/etc/php/conf.d/redis-session.ini 16 | -------------------------------------------------------------------------------- /containers/php/xdebug.ini: -------------------------------------------------------------------------------- 1 | zend_extension=xdebug.so 2 | 3 | # xdebug version 3 4 | xdebug.start_with_request=trigger 5 | xdebug.client_host=host.docker.internal 6 | 7 | # deprecated xdebug version 2 8 | xdebug.remote_enable=1 9 | xdebug.remote_host=host.docker.internal 10 | 11 | xdebug.discover_client_host = true 12 | xdebug.idekey=PHPSTORM 13 | xdebug.mode=debug,profile 14 | 15 | xdebug.output_dir = "/var/sync/profiler/" 16 | -------------------------------------------------------------------------------- /services/node.yml: -------------------------------------------------------------------------------- 1 | node: 2 | build: 3 | context: containers/node 4 | args: 5 | NODE_VERSION: ${NODE_VERSION} 6 | HOST_USER_ID: ${HOST_USER_ID} 7 | HOST_GROUP_ID: ${HOST_GROUP_ID} 8 | HOST_USER_NAME: ${HOST_USER_NAME} 9 | HOST_GROUP_NAME: ${HOST_GROUP_NAME} 10 | user: ${HOST_USER_ID}:${HOST_GROUP_ID} 11 | working_dir: /var/www 12 | volumes: 13 | - ./source:/var/www:cached -------------------------------------------------------------------------------- /services/selenium-firefox.yml: -------------------------------------------------------------------------------- 1 | seleniumfirefox: 2 | platform: linux/x86_64 3 | image: 'oxidesales/oxideshop-docker-selenium:S2FF31' 4 | restart: always 5 | shm_size: 500M 6 | depends_on: 7 | - php 8 | ports: 9 | - ${PORT_BROWSER_FIREFOX_WEBDRIVER}:4444 10 | - ${PORT_BROWSER_FIREFOX_VNC}:5900 11 | links: 12 | - "apache:localhost.local" 13 | - "apache:oxideshop.local" 14 | volumes: 15 | - ./source:/var/www:cached 16 | -------------------------------------------------------------------------------- /services/nginx-rp.yml: -------------------------------------------------------------------------------- 1 | nginx: 2 | platform: linux/x86_64 3 | image: oxidesales/oxideshop-docker-nginx:${NGINX_VERSION} 4 | restart: always 5 | ports: 6 | - ${PORT_SHOP}:80 7 | depends_on: 8 | - apache 9 | volumes: 10 | - ${NGINX_SERVER_CONFIG_DIR}/ClearCache.lua:/var/www/oxideshop/vendor/oxid-esales/nginx-module/ServerConfiguration/ClearCache.lua:cached 11 | - ${NGINX_SERVER_CONFIG_DIR}/nginx.conf:/etc/nginx/sites-enabled/default:cached 12 | -------------------------------------------------------------------------------- /recipes/default/example/examples/database_example.php: -------------------------------------------------------------------------------- 1 | setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 10 | echo "Connected successfully"; 11 | } 12 | catch(PDOException $e) 13 | { 14 | echo "Connection failed: " . $e->getMessage(); 15 | } 16 | -------------------------------------------------------------------------------- /services/selenium-chrome.yml: -------------------------------------------------------------------------------- 1 | selenium: 2 | platform: linux/x86_64 3 | image: 'selenium/standalone-chrome:latest' 4 | restart: always 5 | shm_size: 500M 6 | depends_on: 7 | - php 8 | healthcheck: 9 | test: /opt/bin/check-grid.sh 10 | interval: 1s 11 | retries: 60 12 | ports: 13 | - ${PORT_BROWSER_CHROME_WEBDRIVER}:4444 14 | - ${PORT_BROWSER_CHROME_VNC}:5900 15 | links: 16 | - "apache:localhost.local" 17 | - "apache:oxideshop.local" 18 | volumes: 19 | - ./source:/var/www:cached 20 | -------------------------------------------------------------------------------- /services/selenium-chrome-126.yml: -------------------------------------------------------------------------------- 1 | selenium: 2 | platform: linux/x86_64 3 | image: 'selenium/standalone-chrome:126.0-chromedriver-126.0' 4 | restart: always 5 | shm_size: 500M 6 | depends_on: 7 | - php 8 | healthcheck: 9 | test: /opt/bin/check-grid.sh 10 | interval: 1s 11 | retries: 60 12 | ports: 13 | - ${PORT_BROWSER_CHROME_WEBDRIVER}:4444 14 | - ${PORT_BROWSER_CHROME_VNC}:5900 15 | links: 16 | - "apache:localhost.local" 17 | - "apache:oxideshop.local" 18 | volumes: 19 | - ./source:/var/www:cached 20 | -------------------------------------------------------------------------------- /services/selenium-chrome-debug.yml: -------------------------------------------------------------------------------- 1 | ## deprecated, only use if necessary (e.g. B2B) 2 | selenium: 3 | platform: linux/x86_64 4 | image: 'selenium/standalone-chrome-debug:3.141.59' 5 | restart: always 6 | shm_size: 500M 7 | depends_on: 8 | - php 9 | healthcheck: 10 | test: /opt/bin/check-grid.sh 11 | interval: 1s 12 | retries: 60 13 | ports: 14 | - ${PORT_BROWSER_CHROME_WEBDRIVER}:4444 15 | - ${PORT_BROWSER_CHROME_VNC}:5900 16 | links: 17 | - "apache:localhost.local" 18 | - "apache:oxideshop.local" 19 | volumes: 20 | - ./source:/var/www:cached 21 | -------------------------------------------------------------------------------- /services/varnish-rp.yml: -------------------------------------------------------------------------------- 1 | varnish: 2 | image: ${VARNISH_IMAGE} 3 | restart: always 4 | ports: 5 | - ${PORT_SHOP}:80 6 | depends_on: 7 | - apache 8 | volumes: 9 | ## Varnish v4 oxid container configuration mount 10 | - ${VARNISH_CONFIG_DIR}/default.vcl:/usr/local/etc/varnish/default.vcl 11 | - ${VARNISH_CONFIG_DIR}/servers_conf.vcl:/usr/local/etc/varnish/servers_conf.vcl 12 | ## Varnish v6 official official image configuration mount 13 | - ${VARNISH_CONFIG_DIR}/default.vcl:/etc/varnish/default.vcl 14 | - ${VARNISH_CONFIG_DIR}/servers_conf.vcl:/etc/varnish/servers_conf.vcl 15 | -------------------------------------------------------------------------------- /containers/httpd/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM httpd:2.4-alpine 2 | 3 | COPY custom.conf /usr/local/apache2/conf/custom.conf 4 | COPY project.conf /usr/local/apache2/conf/project.conf 5 | 6 | COPY certs/server.crt /usr/local/apache2/conf/server.crt 7 | COPY certs/server.key /usr/local/apache2/conf/server.key 8 | 9 | RUN printf "Include conf/custom.conf\n" >> /usr/local/apache2/conf/httpd.conf && \ 10 | printf "Include conf/project.conf" >> /usr/local/apache2/conf/httpd.conf 11 | 12 | RUN sed -i \ 13 | -e 's/^#\(Include .*httpd-ssl.conf\)/\1/' \ 14 | -e 's/^#\(LoadModule .*mod_ssl.so\)/\1/' \ 15 | -e 's/^#\(LoadModule .*mod_socache_shmcb.so\)/\1/' \ 16 | conf/httpd.conf -------------------------------------------------------------------------------- /containers/node/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG NODE_VERSION 2 | 3 | FROM node:$NODE_VERSION 4 | 5 | ARG HOST_USER_ID 6 | ARG HOST_USER_NAME 7 | ARG HOST_GROUP_ID 8 | ARG HOST_GROUP_NAME 9 | 10 | RUN mkdir /var/www 11 | 12 | RUN id -u node >/dev/null 2>&1 && \ 13 | groupmod -g 1099 node && \ 14 | usermod -u 1099 -g 1099 node || \ 15 | echo "User 'node' does not exist, skipping usermod and groupmod" 16 | 17 | RUN groupadd -f -g $HOST_GROUP_ID $HOST_GROUP_NAME && \ 18 | useradd -m -d /home/$HOST_USER_NAME -s /bin/bash -g $HOST_GROUP_ID -u $HOST_USER_ID $HOST_USER_NAME || true && \ 19 | echo "$HOST_USER_NAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \ 20 | chown -R $HOST_USER_NAME:$HOST_GROUP_NAME /var/www/ -------------------------------------------------------------------------------- /containers/httpd/custom.conf: -------------------------------------------------------------------------------- 1 | LoadModule proxy_module modules/mod_proxy.so 2 | LoadModule rewrite_module modules/mod_rewrite.so 3 | LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so 4 | 5 | LoadModule http2_module modules/mod_http2.so 6 | 7 | 8 | Protocols h2 http/1.1 9 | 10 | 11 | 12 | DirectoryIndex index.php index.html 13 | 14 | 15 | DocumentRoot "/var/www/" 16 | 17 | Options Indexes FollowSymLinks 18 | AllowOverride All 19 | Require all granted 20 | 21 | 22 | 23 | 24 | SetHandler "proxy:fcgi://php:9000" 25 | 26 | -------------------------------------------------------------------------------- /containers/httpd/project.conf.dist: -------------------------------------------------------------------------------- 1 | DocumentRoot "/var/www/" 2 | 3 | Options Indexes FollowSymLinks 4 | AllowOverride All 5 | Require all granted 6 | 7 | 8 | 9 | DocumentRoot "/var/www/" 10 | ServerName localhost.local 11 | ServerAlias oxideshop.local 12 | 13 | SSLEngine on 14 | 15 | AllowOverride All 16 | Require all granted 17 | 18 | 19 | SSLCertificateFile "/usr/local/apache2/conf/server.crt" 20 | SSLCertificateKeyFile "/usr/local/apache2/conf/server.key" 21 | Protocols h2 http/1.1 22 | 23 | 24 | 25 | # For local development with Xdebug, it's convenient to have a longer timeout than the default. 26 | Timeout 600 -------------------------------------------------------------------------------- /services/mysql.yml: -------------------------------------------------------------------------------- 1 | mysql: 2 | platform: linux/amd64 3 | image: oxidesales/oxideshop-docker-database:${MYSQL_VERSION} 4 | cap_add: 5 | - SYS_NICE # CAP_SYS_NICE 6 | environment: 7 | MYSQL_DATABASE: ${MYSQL_DATABASE:-example} 8 | MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root} 9 | MARIADB_DATABASE: ${MARIADB_DATABASE:-example} 10 | healthcheck: 11 | test: out=$$(mysqladmin ping -h localhost -P 3306 -u root --password=$${MYSQL_ROOT_PASSWORD} 2>&1); echo $$out | grep 'mysqld is alive' || { echo $$out; exit 1; } 12 | start_period: 30s 13 | interval: 2s 14 | retries: 180 15 | restart: always 16 | user: ${HOST_USER_ID}:${HOST_GROUP_ID} 17 | volumes: 18 | - ./data/mysql:/var/lib/mysql:delegated 19 | ports: 20 | - ${PORT_MYSQL}:3306 # to access mysql with local client 21 | -------------------------------------------------------------------------------- /containers/loadbalancer/loadbalancer.conf.dist: -------------------------------------------------------------------------------- 1 | upstream frontend { 2 | } 3 | 4 | server { 5 | listen 80; 6 | 7 | server_name localhost.local max_fails=0; 8 | 9 | proxy_set_header Host $host; 10 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 11 | proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto; 12 | proxy_set_header X-Real-IP $http_x_real_ip; 13 | proxy_set_header Accept-Encoding ""; 14 | proxy_set_header Connection ""; 15 | proxy_set_header HTTPS $http_https; 16 | proxy_set_header Proxy ""; 17 | proxy_set_header X-Country-Code $http_x_country_code; 18 | 19 | location ~* (/out)?/admin.*/ { 20 | proxy_pass http://apache:80; 21 | } 22 | 23 | location / { 24 | proxy_pass http://frontend; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /services/php.yml: -------------------------------------------------------------------------------- 1 | php: 2 | platform: linux/x86_64 3 | build: 4 | context: containers/php 5 | args: 6 | PHP_VERSION: ${PHP_VERSION} 7 | HOST_USER_ID: ${HOST_USER_ID} 8 | HOST_GROUP_ID: ${HOST_GROUP_ID} 9 | HOST_USER_NAME: ${HOST_USER_NAME} 10 | HOST_GROUP_NAME: ${HOST_GROUP_NAME} 11 | links: 12 | - "apache:localhost.local" 13 | - "apache:oxideshop.local" 14 | volumes: 15 | - ./source:/var/www:cached 16 | - ./data/php:/var/sync:cached 17 | - ./data/composer:/home/${HOST_USER_NAME}/.composer/:cached 18 | user: ${HOST_USER_ID}:${HOST_GROUP_ID} 19 | depends_on: 20 | mailpit: 21 | condition: service_started 22 | apache: 23 | condition: service_started 24 | mysql: 25 | condition: service_healthy 26 | extra_hosts: 27 | - "host.docker.internal:host-gateway" 28 | -------------------------------------------------------------------------------- /.env.dist: -------------------------------------------------------------------------------- 1 | HOST_USER_ID= 2 | HOST_GROUP_ID= 3 | 4 | HOST_USER_NAME= 5 | HOST_GROUP_NAME= 6 | 7 | PHP_VERSION=8.1 8 | 9 | MYSQL_VERSION=5.7 10 | MYSQL_ROOT_PASSWORD=root 11 | MYSQL_DATABASE=example 12 | 13 | ELASTICSEARCH_VERSION=6.8.23 14 | KIBANA_VERSION=6.8.23 15 | 16 | NGINX_VERSION=1.24 17 | NGINX_SERVER_CONFIG_DIR='./source/dev-packages/nginx/ServerConfiguration' 18 | 19 | VARNISH_IMAGE=varnish:7.5 20 | VARNISH_CONFIG_DIR='./source/vendor/oxid-esales/varnish-configuration' 21 | 22 | NODE_VERSION=latest 23 | 24 | ADMIN_PASSWORD=admin 25 | 26 | # Ports exposed to the host 27 | PORT_SHOP=80 28 | PORT_SSL_SHOP=443 29 | PORT_SHOP_WITH_RP=8000 30 | PORT_ADMINER=8080 31 | PORT_ELASTIC_SEARCH=9200 32 | PORT_KIBANA=5601 33 | PORT_MAILPIT_SMTP=1025 34 | PORT_MAILPIT_WEBUI=8025 35 | PORT_MYSQL=3306 36 | PORT_BROWSER_CHROME_WEBDRIVER=4444 37 | PORT_BROWSER_CHROME_VNC=5900 38 | PORT_BROWSER_FIREFOX_WEBDRIVER=4445 39 | PORT_BROWSER_FIREFOX_VNC=5901 40 | -------------------------------------------------------------------------------- /containers/php/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PHP_VERSION 2 | 3 | FROM oxidesales/oxideshop-docker-php:$PHP_VERSION 4 | 5 | ARG HOST_USER_ID 6 | ARG HOST_USER_NAME 7 | ARG HOST_GROUP_ID 8 | ARG HOST_GROUP_NAME 9 | ARG SMTP_HOST 10 | ARG SMTP_PORT 11 | 12 | COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini 13 | COPY custom.ini /usr/local/etc/php/conf.d/zcustom.ini 14 | 15 | # add redis 16 | ARG INSTALL_REDIS_EXTENSION=false 17 | RUN if [ "$INSTALL_REDIS_EXTENSION" = "true" ]; then \ 18 | pecl install redis \ 19 | && docker-php-ext-enable redis; \ 20 | fi 21 | 22 | # set sendmail for php to ssmtp 23 | RUN printf "host mailpit\nport 1025" >> /etc/msmtprc 24 | 25 | RUN groupadd -f -g $HOST_GROUP_ID $HOST_GROUP_NAME && \ 26 | useradd -m -d /home/$HOST_USER_NAME -s /bin/bash -g $HOST_GROUP_ID -u $HOST_USER_ID $HOST_USER_NAME || true && \ 27 | echo "$HOST_USER_NAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \ 28 | chown -R $HOST_USER_NAME:$HOST_GROUP_NAME /var/www/ 29 | 30 | RUN mkdir /home/$HOST_USER_NAME/.ssh && \ 31 | ssh-keyscan -t rsa github.com >> /home/$HOST_USER_NAME/.ssh/known_hosts 32 | 33 | WORKDIR /var/www/ 34 | -------------------------------------------------------------------------------- /recipes/default/example/examples/email_example.php: -------------------------------------------------------------------------------- 1 | SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output 14 | 15 | //Recipients 16 | $mail->setFrom('admin@myserver.com', 'Mailer'); 17 | $mail->addAddress('joe@example.net', 'Joe User'); //Add a recipient 18 | 19 | //Content 20 | $mail->isHTML(true); //Set email format to HTML 21 | $mail->Subject = 'Here is the subject'; 22 | $mail->Body = 'This is the HTML message body in bold!'; 23 | $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; 24 | 25 | $mail->send(); 26 | echo 'Message has been sent'; 27 | } catch (Exception $e) { 28 | echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; 29 | } 30 | -------------------------------------------------------------------------------- /containers/httpd/certs/server.csr: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIIDdzCCAl8CAQAwgYoxFzAVBgNVBAoMDk9YSUQgZVNhbGVzIEFHMR8wHQYDVQQL 3 | DBZEZXZlbG9wbWVudCBEZXBhcnRtZW50MSkwJwYDVQQDDCBMb2NhbGhvc3QgU2Vy 4 | dmVyIFNTTC1DZXJ0aWZpY2F0ZTEjMCEGCSqGSIb3DQEJARYUaW5mb0BveGlkLWVz 5 | YWxlcy5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC0aWjDHECg 6 | +1jvT5bE3FQ3t2UaxVkxkFXcgm1ofhWhNxntfKMIN5EvBtYNMx/V4FEN7rcqVZsy 7 | lmwtKykoM/XPP+Vq7eW8NPtemU/LpjodMI+6rFNgXCb7/wMda5HjRQh7L8sfsh3V 8 | 0DYLNJ03BeTele+aaCqDZj/TNT6rFi03eKZbst3Y1bnkJeSiVHFgf1Ppa72JKCjN 9 | pLyLx8hFREP4q1/77SJGgPPOJj4Lrra5ZwRlu0spc1K4Xm5v1SXceM0VaPny3/Pe 10 | 7CzZkq3hBAcQbNJfQbhenfPj++HdevX9S5X/0Vuw8WWPaa6z3xlfdFffniSSWeQz 11 | Ln6ObzwUb/3PAgMBAAGggaYwgaMGCSqGSIb3DQEJDjGBlTCBkjAdBgNVHQ4EFgQU 12 | cZi/9NCbj/jPJ/UO7JckD/SLxRowCQYDVR0TBAIwADALBgNVHQ8EBAMCBaAwKwYD 13 | VR0RBCQwIoIPbG9jYWxob3N0LmxvY2Fsgglsb2NhbGhvc3SHBH8AAAEwLAYJYIZI 14 | AYb4QgENBB8WHU9wZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMA0GCSqGSIb3 15 | DQEBCwUAA4IBAQCBPUL4UW880IrT5ctz0MiUMlGCCLpibYY8kVn8ZK+mNa7VUlIK 16 | C78xLgtuDdpUggkhzTlllvGV8D+CpSo72PXpjPdhsSM2M9pyMIey0KwbMO6bsdK1 17 | 7CzAy6gaYiIhUnNZ2mn+z9ymFVxagF53c0XybAoHE9naMQFLlIdenM3AM71pE+sB 18 | Q37aM8+hNaZS7Fl9oVxt6s8ubJ9UeCbHDZkPvh2HT6Zjy+5KFZUQIhkkVZ8+Lg5D 19 | Ow8qrwrmC0AIK8rIZXzdPeE7fR83GvpeRyyNMTqFPHmWpkh0YEKg95mvHbKo+E6z 20 | gc3hxaod1Bf+uD8H6lmTI9IIbcriSS++YVKB 21 | -----END CERTIFICATE REQUEST----- 22 | -------------------------------------------------------------------------------- /containers/httpd/certs/openssl-server.conf: -------------------------------------------------------------------------------- 1 | HOME = . 2 | RANDFILE = $ENV::HOME/.rnd 3 | 4 | #################################################################### 5 | [ req ] 6 | default_bits = 2048 7 | default_keyfile = server.key 8 | distinguished_name = server_distinguished_name 9 | req_extensions = server_req_extensions 10 | string_mask = utf8only 11 | 12 | #################################################################### 13 | [ server_distinguished_name ] 14 | 15 | organizationName = Organization Name (eg, company) 16 | organizationName_default = OXID eSales AG 17 | 18 | organizationalUnitName = Organizational Unit (eg, division) 19 | organizationalUnitName_default = Development Department 20 | 21 | commonName = Common Name (e.g. server FQDN or YOUR name) 22 | commonName_default = Localhost Server SSL-Certificate 23 | 24 | emailAddress = Email Address 25 | emailAddress_default = info@oxid-esales.com 26 | 27 | #################################################################### 28 | [ server_req_extensions ] 29 | 30 | subjectKeyIdentifier = hash 31 | basicConstraints = CA:FALSE 32 | keyUsage = digitalSignature, keyEncipherment 33 | subjectAltName = @alternate_names 34 | nsComment = "OpenSSL Generated Certificate" 35 | 36 | #################################################################### 37 | [ alternate_names ] 38 | 39 | DNS.1 = localhost.local 40 | DNS.2 = localhost 41 | IP.1 = 127.0.0.1 -------------------------------------------------------------------------------- /containers/httpd/certs/server.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC0aWjDHECg+1jv 3 | T5bE3FQ3t2UaxVkxkFXcgm1ofhWhNxntfKMIN5EvBtYNMx/V4FEN7rcqVZsylmwt 4 | KykoM/XPP+Vq7eW8NPtemU/LpjodMI+6rFNgXCb7/wMda5HjRQh7L8sfsh3V0DYL 5 | NJ03BeTele+aaCqDZj/TNT6rFi03eKZbst3Y1bnkJeSiVHFgf1Ppa72JKCjNpLyL 6 | x8hFREP4q1/77SJGgPPOJj4Lrra5ZwRlu0spc1K4Xm5v1SXceM0VaPny3/Pe7CzZ 7 | kq3hBAcQbNJfQbhenfPj++HdevX9S5X/0Vuw8WWPaa6z3xlfdFffniSSWeQzLn6O 8 | bzwUb/3PAgMBAAECggEAfE505Jq+3SzSJnIMTDATxyASBdQclM4CmyEzCWB2vtIc 9 | h0nte2fuHRz0t7uWH+OjdZoZko3RlZWXi7fFb/H9WIOKK5cnR/qpiJDSLlumhx5C 10 | qji6ahaUteUL3GWV66ZRJa/UoU40yHHiCu6BtLvW6pcctKM5R7hYGcsCFxf8p87M 11 | 6VaaMBDx8da08KJ5k4CRs3IMBOqtli/PbJWRmpVx6GgeQiNRrPjTXCB7q8P4nqKF 12 | msvT3D7ZNl+NPY8pbT8B1aLJLponEhQEYLpjn0MACc/jMHNJn1M9bvnXKK77XMPd 13 | 9OvzjDToN+5NIbQmvZznQ6oDoGgHPpTnZWJTfFmR4QKBgQDlWYquw2477CGJv9HB 14 | bUzhxv4pHiG8HvuhW4E0dogMxy7YIhcaPxsjiUMv2AKZWuLYHhUz6g2U1PZCiIV1 15 | jdLP+YyDLSk6bmng/ijX8rKYz8u6REqheKpYRwpLLQ/duvqqPGAcXx8LBrqUExgl 16 | sw8aUwyArstl58b5xvcrcEq06wKBgQDJYBw8YT2qFRXM7k5KgTu2wTxxHa5yTR5+ 17 | 38oi91riJO9CyW6DHiDlfUNAkOBn01SBMpLkHFigT4a4MxKaTusFxI0rXRYMeywc 18 | Kcq7dSPsCW8bxu7eX1vq4QvzJsHVdEcb7L+6xaFYq273tJy5kKng6Rsz2eAh3wfJ 19 | v9zKgkhxrQKBgQCvXL27Tta0nqIuLyr02NvWLk8bpVxp+M6x28N5F8CC9LGOtNIx 20 | UVsw2r0ykdm65FFaqfXQUf+8cvEwgi55ac1tFAQqMJe7g70VOYCFTZ7dVNUTQTBH 21 | MnodMYRfYr8k7NjI3Y0nZFvaFHUIz2jBOp4rpKCErCH9czEivs0yu5ODrQKBgQCS 22 | be+6PB9h2Nk0XijR5m0sdBDmU+XwuYEuUr6idGlCvga48s4IS9Ux6scHYRG8jaAK 23 | HmNPugj78TgOIx0o1a/yTr00RgjtZHdrtzvy2bgYP7fqY9p4GrE09xYAZjNWaqn2 24 | dU3pmyG631XeixfXm4jbwcWFC63+EzaPjpMXMmtJNQKBgQDVNB74gbplEbt9YGPb 25 | UtEU/PBwTEU9Jvs5RwVPwdzGvbCXshMlI34K6xvJ7Y43ngtJiLubuNyKkSlTBoq/ 26 | 978lzLj9YgG9A8blPKQx/mPCm1KCV8UZ6mbku7gmPlZ9wBEFXvxaNtmJjeFExA7H 27 | 1iBA8koc2GfOV818laUO+6XvzA== 28 | -----END PRIVATE KEY----- 29 | -------------------------------------------------------------------------------- /containers/httpd/certs/server.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIFEjCCAvqgAwIBAgIBATANBgkqhkiG9w0BAQsFADB2MRcwFQYDVQQKDA5PWElE 3 | IGVTYWxlcyBBRzEfMB0GA1UECwwWRGV2ZWxvcG1lbnQgRGVwYXJ0bWVudDEVMBMG 4 | A1UEAwwMTG9jYWxob3N0IENBMSMwIQYJKoZIhvcNAQkBFhRpbmZvQG94aWQtZXNh 5 | bGVzLmNvbTAeFw0yNDEyMTAwODE0MzRaFw0yNTEyMTAwODE0MzRaMIGKMRcwFQYD 6 | VQQKDA5PWElEIGVTYWxlcyBBRzEfMB0GA1UECwwWRGV2ZWxvcG1lbnQgRGVwYXJ0 7 | bWVudDEpMCcGA1UEAwwgTG9jYWxob3N0IFNlcnZlciBTU0wtQ2VydGlmaWNhdGUx 8 | IzAhBgkqhkiG9w0BCQEWFGluZm9Ab3hpZC1lc2FsZXMuY29tMIIBIjANBgkqhkiG 9 | 9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtGlowxxAoPtY70+WxNxUN7dlGsVZMZBV3IJt 10 | aH4VoTcZ7XyjCDeRLwbWDTMf1eBRDe63KlWbMpZsLSspKDP1zz/lau3lvDT7XplP 11 | y6Y6HTCPuqxTYFwm+/8DHWuR40UIey/LH7Id1dA2CzSdNwXk3pXvmmgqg2Y/0zU+ 12 | qxYtN3imW7Ld2NW55CXkolRxYH9T6Wu9iSgozaS8i8fIRURD+Ktf++0iRoDzziY+ 13 | C662uWcEZbtLKXNSuF5ub9Ul3HjNFWj58t/z3uws2ZKt4QQHEGzSX0G4Xp3z4/vh 14 | 3Xr1/UuV/9FbsPFlj2mus98ZX3RX354kklnkMy5+jm88FG/9zwIDAQABo4GVMIGS 15 | MB0GA1UdDgQWBBRxmL/00JuP+M8n9Q7slyQP9IvFGjAJBgNVHRMEAjAAMAsGA1Ud 16 | DwQEAwIFoDArBgNVHREEJDAigg9sb2NhbGhvc3QubG9jYWyCCWxvY2FsaG9zdIcE 17 | fwAAATAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNh 18 | dGUwDQYJKoZIhvcNAQELBQADggIBAKBuqcpzaS7fG04SY87GCwNq8ooY9CLOeuwt 19 | qi6ZqHnJlEkvsDLHDns4BoNBDnVp216ofwE3iWW1a8DBEOVvLvM8rvZsM+FnN6pR 20 | bpKlp6nGFjn9u6Kgu45tOFbFjvhDKrM0V0jphCYJTu8uD+HnYxCnFXWo6oQ8/pdK 21 | YEsABAEM7BvwVKHVkDBhPGgBNu9SqKN5Kjq/pI9s4CZ5eWu0iz/BzhX2KItwFK9q 22 | 8N62olMLnTFrjcDxycgjHpqdqrGsKZsWu1b16RbZjiui8+5bn+5bsBAZ6109L+jz 23 | 9uBAvUqFx8SzpNaXNG1WliUTvZZzK0TfoYpeTzXQRoItXalaE+8ZGYmWcsGZOM4I 24 | 4/bTMf3Soi8ecrN4ByXSp/RykzIGBOPSl5z7YdoTFp9WuFflHETMljq4Thw9AV6S 25 | AKV2cBfL7f6vGxGswawFghbHJ5Xuk2M8hVyqd/GzBm6baLJ6oNsFbtnorwoC1Wq/ 26 | I7qKrngF1MyYbjErgMlz5uS0DpNGDvG93yLHdCQ11F5EL6mJ33CycstD6H2OCJAJ 27 | IHcBNEYJuBSKTtsXh1W1i2DZ3k8LHbEplX9REzHHuBVmz+avNcxIDGqhNl7Vmc6j 28 | esd96wOYMct+CvQ2i+w7aD/t4HjtyCb/TaYxyhZTpu353Copa4tEnsW+wmbhS2yn 29 | 3Ke2JTfa 30 | -----END CERTIFICATE----- 31 | -------------------------------------------------------------------------------- /containers/httpd/certs/oxid_esales_localhost_ca.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | 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 33 | Ksqb 34 | -----END CERTIFICATE----- 35 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | USERID = `id -u` 2 | USERNAME = `id -un` 3 | GROUPID = `id -g` 4 | GROUPNAME = `id -gn` 5 | 6 | default: help 7 | 8 | help: 9 | @printf "\n\ 10 | \e[1;1;33mSome Help needed?\e[0m\n\n\ 11 | \e[1;1;32mmake setup\e[0m - Prefills the .env file with sync required parameters \n\ 12 | and prepares all modifiable custom files from dist. Run this \n\ 13 | once before everything!\n\n\ 14 | \e[1;1;32mmake addbasicservices\e[0m - Adds php, apache and mysql services \n\ 15 | \e[1;1;32mmake file=... addservice\e[0m - Prepend file contents to current docker-compose.yml file\n\n\ 16 | \e[1;1;32mmake up\e[0m - Start all configured containers (have you run setup command already?)!\n\ 17 | \e[1;1;32mmake down\e[0m - Stop all configured containers\n\n\ 18 | \e[1;1;32mmake example\e[0m - Setup basic services + Runs example recipe\n\n\ 19 | \e[1;1;32mmake php\e[0m - Connect to php container shell\n\ 20 | \e[1;1;32mmake node\e[0m - Connect to node container shell\n\ 21 | " 22 | 23 | setup: 24 | @cat .env.dist | \ 25 | sed "s//$(USERID)/;\ 26 | s//$(USERNAME)/;\ 27 | s//$(GROUPID)/;\ 28 | s//$(GROUPNAME)/"\ 29 | > .env 30 | @cp -n containers/httpd/project.conf.dist containers/httpd/project.conf 31 | @cp -n containers/php/custom.ini.dist containers/php/custom.ini 32 | @cp -n docker-compose.yml.dist docker-compose.yml 33 | 34 | example: 35 | @make addbasicservices 36 | @./recipes/default/example/run.sh 37 | 38 | up: 39 | docker compose up --build -d 40 | 41 | down: 42 | docker compose down --remove-orphans 43 | 44 | php: 45 | docker compose exec php bash 46 | 47 | generate-docs: 48 | docker compose run --rm sphinx sphinx-build /home/$(USERNAME)/docs /home/$(USERNAME)/docs/build 49 | 50 | node: 51 | docker compose run --rm node bash 52 | 53 | addservice: 54 | @cat $(file) >> docker-compose.yml 55 | @printf "\n" >> docker-compose.yml 56 | @printf "Service file $(file) contents added\n"; 57 | 58 | addbasicservices: 59 | @make file=services/apache.yml addservice 60 | @make file=services/php.yml addservice 61 | @make file=services/mailpit.yml addservice 62 | @make file=services/mysql.yml addservice 63 | @printf "php, apache and mysql related services added\n"; 64 | 65 | addsphinxservice: 66 | @printf "\nDOC_PATH=$(docpath)" >> .env 67 | @make file=services/sphinx.yml addservice 68 | 69 | addredisservice: 70 | @cp services/redis.override.yml docker-compose.override.yml 71 | @printf "Redis service added\n"; 72 | 73 | cleanup: 74 | @read -p "Are you sure you want to clean up everything? Warning! Source directory will be removed! [y/N]" confirm && [ "$$confirm" = "y" ] || exit 1 75 | -make down 76 | -[ -d "source" ] && rm -rf source 77 | -[ -e ".env" ] && rm .env 78 | -[ -e "docker-compose.yml" ] && rm docker-compose.yml 79 | -[ -e "containers/httpd/project.conf" ] && rm containers/httpd/project.conf 80 | -[ -e "containers/php/custom.ini" ] && rm containers/php/custom.ini 81 | -[ -d "data/mysql" ] && rm -rf data/mysql/* 82 | -[ -d "data/composer/cache" ] && rm -rf data/composer/cache 83 | -[ -e "docker-compose.override.yml" ] && rm docker-compose.override.yml 84 | -------------------------------------------------------------------------------- /containers/httpd/certs/openssl-ca.conf: -------------------------------------------------------------------------------- 1 | HOME = . 2 | RANDFILE = $ENV::HOME/.rnd 3 | 4 | #################################################################### 5 | [ ca ] 6 | default_ca = CA_default # The default ca section 7 | 8 | [ CA_default ] 9 | 10 | default_days = 3650 # How long to certify for 11 | default_crl_days = 30 # How long before next CRL 12 | default_md = sha256 # Use public key default MD 13 | preserve = no # Keep passed DN ordering 14 | 15 | x509_extensions = ca_extensions # The extensions to add to the cert 16 | 17 | email_in_dn = no # Don't concat the email in the DN 18 | copy_extensions = copy # Required to copy SANs from CSR to cert 19 | 20 | #################################################################### 21 | base_dir = . 22 | certificate = $base_dir/oxid_esales_localhost_ca.crt # The CA certifcate 23 | private_key = $base_dir/ca.key # The CA private key 24 | new_certs_dir = $base_dir # Location for new certs after signing 25 | database = $base_dir/index.txt # Database index file 26 | serial = $base_dir/serial.txt # The current serial number 27 | 28 | unique_subject = no # Set to 'no' to allow creation of 29 | # several certificates with same subject. 30 | #################################################################### 31 | 32 | #################################################################### 33 | [ req ] 34 | default_bits = 4096 35 | default_keyfile = ca.key 36 | distinguished_name = ca_distinguished_name 37 | x509_extensions = ca_extensions 38 | string_mask = utf8only 39 | 40 | #################################################################### 41 | [ ca_distinguished_name ] 42 | 43 | organizationName = Organization Name (eg, company) 44 | organizationName_default = OXID eSales AG 45 | 46 | organizationalUnitName = Organizational Unit (eg, division) 47 | organizationalUnitName_default = Development Department 48 | 49 | commonName = Common Name (e.g. server FQDN or YOUR name) 50 | commonName_default = Localhost CA 51 | 52 | emailAddress = Email Address 53 | emailAddress_default = info@oxid-esales.com 54 | 55 | #################################################################### 56 | [ ca_extensions ] 57 | 58 | subjectKeyIdentifier = hash 59 | authorityKeyIdentifier = keyid:always, issuer 60 | basicConstraints = critical, CA:true 61 | keyUsage = keyCertSign, cRLSign 62 | 63 | #################################################################### 64 | #################################################################### 65 | [ signing_policy ] 66 | countryName = optional 67 | stateOrProvinceName = optional 68 | localityName = optional 69 | organizationName = optional 70 | organizationalUnitName = optional 71 | commonName = supplied 72 | emailAddress = optional 73 | 74 | #################################################################### 75 | [ signing_req ] 76 | subjectKeyIdentifier = hash 77 | authorityKeyIdentifier = keyid,issuer 78 | basicConstraints = CA:FALSE 79 | keyUsage = digitalSignature, keyEncipherment 80 | #################################################################### 81 | -------------------------------------------------------------------------------- /containers/httpd/certs/ca.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | 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 51 | zpB0pak2PjKlqnnq59DJpOzLMckOmw== 52 | -----END PRIVATE KEY----- 53 | -------------------------------------------------------------------------------- /containers/httpd/certs/README.md: -------------------------------------------------------------------------------- 1 | # SSL-Certificates for HTTPS and HTTP/2 support 2 | 3 | ## ATTENTION: 4 | The following steps are not necessary anymore, as the needed CA-files and the SSL-certificates 5 | for the server are already existing in the current directory (`containers/httpd/certs`) of the SDK. 6 | 7 | 8 | ## Generation of certificates: 9 | 10 | **1. Create a Certificate Authority (CA):** 11 | 12 | Configurations, done in `openssl-ca.conf`, are used to create the *CA-Certificate* (`oxid_esales_localhost_ca.crt`) 13 | and the *CA-Key* (`ca.key`). 14 | 15 | ```shell 16 | openssl req -x509 -config openssl-ca.conf -days 365 -newkey rsa:4096 -sha256 -nodes -out oxid_esales_localhost_ca.crt 17 | ``` 18 | 19 | **2. Generate the Server Key and Certificate Signing Request (CSR):** 20 | 21 | Configurations, done in `openssl-server.conf`, are used to create the *Certificate Signing Request (CSR)* for the server 22 | (`server.csr`) and the SSL-key (`server.key`). 23 | 24 | ```shell 25 | openssl req -config openssl-server.conf -newkey rsa:2048 -sha256 -nodes -out server.csr 26 | ``` 27 | 28 | The *Certificate Signing Request (CSR)* is used to generate the final SSL-Certificate. 29 | 30 | **3. Sign the Server Certificate:** 31 | 32 | The *CA-Certificate* will be used to sign the previously created *Certificate Signing Request (CSR)* and finally creates 33 | the SSL-Certificate (`server.crt`) for the server. 34 | 35 | Therefore we have two possibilities: 36 | 37 | - **The first one** creates the SSL-Certificate and the database and serial-files. This is interesting if you might want to 38 | create multiple SSL-Certificates from the CSR. This solution creates and stores and updates the serial-number 39 | automatically in a database (`index.txt`) and a serial-file (`serial.txt`). 40 | To store the serials we need to create database file: 41 | ```shell 42 | touch index.txt 43 | ``` 44 | and the file with the current serial number: 45 | ```shell 46 | echo '01' > serial.txt 47 | ``` 48 | 49 | Afterwards we can generate the *Server SSL-Certificate* by passing the used config file for this process. 50 | 51 | ```shell 52 | openssl ca -config openssl-ca.conf -policy signing_policy -extensions signing_req -out server.crt -infiles server.csr 53 | ``` 54 | 55 | - **The second one** creates the *Server SSL-Certificate* without any database or serial file. Without a database or 56 | serial file, you will need to manage certificate tracking and revocation manually. 57 | 58 | ```shell 59 | openssl x509 -req -in server.csr -CA oxid_esales_localhost_ca.crt -CAkey ca.key -out server.crt -days 365 -sha256 -set_serial 01 -extfile openssl-server.conf -extensions server_req_extensions 60 | ``` 61 | 62 | **The second method without a database file was used for our SSL-Certificate which is already existing in our SDK, because 63 | only a single certificate is necessary for development purpose.** 64 | 65 | ## Adding Self-signed CA Certificates: 66 | 67 | ### Adding Certificates to the Local Key Store: 68 | 69 | #### macOS 70 | 1. **Keychain:** 71 | - Open the Terminal and execute the following command: 72 | ```bash 73 | sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain 74 | ``` 75 | - Replace `` with the path to your certificate. 76 | 77 | 2. **Manual Addition:** 78 | - Open the **Keychain Access** application. 79 | - Drag and drop the `.pem` file into the **"System"** or **"Login"** keychain. 80 | - Right-click the certificate → **Get Info** → **Trust** → Set "When using this certificate" to **Always Trust**. 81 | 82 | --- 83 | 84 | #### Linux 85 | 1. **System-wide CA Store (Debian/Ubuntu):** 86 | - Copy the certificate to the CA directory: 87 | ```bash 88 | sudo cp /usr/local/share/ca-certificates/ 89 | ``` 90 | - Update the CA store: 91 | ```bash 92 | sudo update-ca-certificates 93 | ``` 94 | 95 | 2. **Red Hat/CentOS:** 96 | - Copy the certificate: 97 | ```bash 98 | sudo cp /etc/pki/ca-trust/source/anchors/ 99 | ``` 100 | - Update the CA store: 101 | ```bash 102 | sudo update-ca-trust 103 | ``` 104 | 105 | --- 106 | 107 | #### Windows 108 | 1. **Management Console (MMC):** 109 | - Press `Win + R`, type `mmc`, and press Enter. 110 | - File → Add/Remove Snap-in → **Certificates** → **Computer Account** → Local Computer 111 | 112 | 2. **Import Certificate:** 113 | - Navigate to **Trusted Root Certification Authorities** → Right-click → **All Tasks** → **Import**. 114 | - Follow the wizard and select the `.pem` or `.crt` file. 115 | 116 | --- 117 | 118 | ### Manually Adding Certificates in Browsers: 119 | 120 | #### Firefox 121 | 1. Open Firefox settings: 122 | - **Settings → Privacy & Security → Certificates → View Certificates**. 123 | 2. Import the certificate: 124 | - Go to the **Authorities** tab → Click **Import**. 125 | - Select the certificate and enable **Trust this CA to identify websites**. 126 | 127 | --- 128 | 129 | #### Chrome 130 | 1. Open Chrome settings: 131 | - **Settings → Privacy and Security → Security → Manage certificates** (under **Advanced** settings). 132 | 2. Import the certificate: 133 | - Switch to the **Authorities** tab → Click **Import**. 134 | - Select the `.pem` or `.crt` file and confirm. 135 | - Enable the appropriate trust options (e.g., **Trust this certificate for identifying websites**) and click **OK**. 136 | 137 | --- 138 | 139 | #### Safari 140 | 1. Open Safari settings: 141 | - Go to **Preferences → Privacy → Manage Website Data** (or **Certificates**, depending on the version). 142 | 2. Import the certificate: 143 | - Drag and drop the certificate into the window or use the import option. 144 | - Confirm the trust settings if prompted. 145 | 146 | --- 147 | 148 | ## Summary 149 | - **System Key Store:** Most browsers (Chrome, Safari) rely on the system-wide certificate store. 150 | - **Browser-specific:** Firefox requires manual configuration, while Chrome and Safari use the system key store by default. 151 | 152 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log for OXID eShop SDK 2 | 3 | All notable changes to this project will be documented in this file. 4 | The format is based on [Keep a Changelog](http://keepachangelog.com/) 5 | and this project adheres to [Semantic Versioning](http://semver.org/). 6 | 7 | ## [v4.1.0] - Unreleased 8 | 9 | ### Added 10 | - Expose mysql port 3306 to access mysql from outside the docker network 11 | - Added deprecated xdebug 2 configuration for php 7.4 12 | - Add NGINX_SERVER_CONFIG_DIR environment variable to nginx configuration directory 13 | - Add NODE_VERSION environment variable for configuring the node container version 14 | - Changed the deprecated image selenium/standalone-chrome-debug:3.141.59 to selenium/standalone-chrome:latest 15 | - Confirmation question on `cleanup` command to avoid accidental data loss 16 | - Redis container preconfigured and ready to use if needed 17 | 18 | ### Changed 19 | - Default Nginx configuration directory changed to fit development practices 20 | - Replace Mailhog with Mailpit service 21 | - Extended MySQL healthcheck time to give chance for slower systems 22 | - Extracted the variables with exposed PORTS to the env file, so it can be easier adjusted [PR-34](https://github.com/OXID-eSales/docker-eshop-sdk/pull/34) 23 | 24 | ### Fixed 25 | - Ensure having the host user and group as file owner in node container 26 | - Replace echo with printf to make it work on Fedora 27 | - Improved the `make cleanup` command to cleanup better on partial file existance 28 | - Remove obsolete "version" option from docker-compose.yml.dist file 29 | - Remove redundant spaces in .env file [PR-33](https://github.com/OXID-eSales/docker-eshop-sdk/pull/33) 30 | 31 | ## [v4.0.0] - 2022-01-11 32 | 33 | ### Added 34 | - Github is trusted by default 35 | - Added environment variable for MySQL version 36 | - Add NGINX container building Dockerfile 37 | - Add NGINX as reverse-proxy service 38 | - Add preconfigured Elasticsearch + Kibana services 39 | - Add self-signed certificate with supported localhost.local and oxideshop.local domains 40 | - `make cleanup` command with all main artifacts removal to clean default state (composer cache is not cleared for now) 41 | 42 | ### Changed 43 | - PHP container is now based on oxidesales/oxideshop-docker-php 44 | - Renamed directory from "php-fpm" to "php" 45 | - Extended description 46 | - Do not cache local .user.ini values 47 | 48 | ### Removed 49 | - SPX is not installed by default anymore 50 | - .env file php version default value fixed 51 | 52 | ### Fixed 53 | - xDebug host calculation configuration improved to work on Mac and Windows WSL too 54 | 55 | ## [v3.0.0] - 2022-02-04 56 | 57 | ### Added 58 | - PHP_VERSION as environment variable 59 | - Example recipe to install example scripts :) The idea is to create multiple different recipes in the future 60 | - Possibility to build specific docker-compose.yml file with console command! 61 | - The file can be build by merging separate smaller chunks (services) together 62 | - The ``make addservice`` command introduced. Example of usage: ``make file=services/apache.yml addservice`` 63 | 64 | ### Changed 65 | - Example files moved to `recipes/default/examples` directory 66 | - Files will be copied during the example recipe - ``make example``. 67 | - Default docker-compose.yml.dist have been split to multiple service files and moved to services directory 68 | - Now, no services are installed by default anymore, but rather, use the ``make addservice`` to add specific services 69 | - To add all basic services (php, mysql and apache), the ``make addbasicservices`` command can be used 70 | 71 | ### Fixed 72 | - Readme adjusted by latest changes, please, read from the start, again. 73 | 74 | ## [v2.0.0] - 2021-12-12 75 | 76 | ### Added 77 | - PHP 8.0 and PHP 8.1 containers! 78 | - Register a link to apache container for the php container (so its possible to ping one by url) 79 | 80 | ### Changed 81 | - Base container repositories renamed to siegfuse/php-fpm-X.X-base where (X.X is php version) 82 | - ``latest`` tag of base container is used by default 83 | - Move SPX package installation to base php container. 84 | - 7.4 base container rebuilt with latest dependencies and spx. 85 | - It will allow faster start of the environment. 86 | - ``containers/php/user.ini`` is renamed to custom.ini.dist. Setup copies it to custom.ini 87 | 88 | ### Fixed 89 | - Fix wrong rights for ~/.composer directory. Now composer commands will work properly. 90 | 91 | ## [v1.4.0] - 2021-11-20 92 | 93 | ### Added 94 | - Copy ``containers/httpd/project.conf.dist`` to ``containers/httpd/project.conf`` during ``make setup`` 95 | - Copy ``docker-compose.yml.dist`` to ``docker-compose.yml`` during ``make setup`` 96 | 97 | ### Changed 98 | - Rename project.conf to project.conf.dist 99 | - Updated the php-fpm image, so it have: 100 | - composer version 2 101 | - xDebug 3 102 | - Use node latest 103 | 104 | ### Fixed 105 | - Configure remote debugging on xDebug 3 106 | - Fix wrong rights on volume synced directory in home of php container 107 | - Update default server for adminer 108 | - Remove node container after use 109 | 110 | ## [v1.3.0] - 2021-06-04 111 | 112 | ### Added 113 | - Preconfigure SPX - simple php profiler 114 | 115 | ### Changed 116 | - Mysql data is now saved between session. Mysql databases are synced to the host system in `data/mysql` directory 117 | 118 | ## [v1.2.0] - 2021-03-18 119 | 120 | ### Added 121 | - Mailhog container preconfigured in docker-compose 122 | - Example with php sending email added 123 | - Makefile command ``make php`` to access bash on php container 124 | 125 | ### Changed 126 | - Reconfigured php log and profiler paths to be always available and no additional configuration required. Available in `data/php` directory. 127 | 128 | ## [v1.1.0] - 2021-03-16 129 | 130 | ### Added 131 | - Makefile with main commands: 132 | - preconfigure with ``make setup`` 133 | - start containers with ``make up`` 134 | - stop containers with ``make down`` 135 | 136 | ## [v1.0.0] - 2019-10-23 137 | 138 | [v4.1.0]: https://github.com/OXID-eSales/docker-eshop-sdk/compare/v4.0.0...master 139 | [v4.0.0]: https://github.com/OXID-eSales/docker-eshop-sdk/compare/v3.0.0...v4.0.0 140 | [v3.0.0]: https://github.com/OXID-eSales/docker-eshop-sdk/compare/v2.0.0...v3.0.0 141 | [v2.0.0]: https://github.com/OXID-eSales/docker-eshop-sdk/compare/v1.4.0...v2.0.0 142 | [v1.4.0]: https://github.com/OXID-eSales/docker-eshop-sdk/compare/v1.3.0...v1.4.0 143 | [v1.3.0]: https://github.com/OXID-eSales/docker-eshop-sdk/compare/v1.2.0...v1.3.0 144 | [v1.2.0]: https://github.com/OXID-eSales/docker-eshop-sdk/compare/v1.1.0...v1.2.0 145 | [v1.1.0]: https://github.com/OXID-eSales/docker-eshop-sdk/compare/v1.0.0...v1.1.0 146 | [v1.0.0]: https://github.com/OXID-eSales/docker-eshop-sdk/020f452b2a...v1.0.0 147 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Development base 2 | 3 | Docker based local environment that can be combined with https://github.com/OXID-eSales/docker-eshop-sdk-recipes for OXID eShop development. 4 | 5 | Php and Npm users are synced with the current user so we will have all the rights to modify and access the content generated by using container commands. 6 | 7 | ## What we have here 8 | 9 | For the start: 10 | 11 | * Apache 2.4 (based on original httpd:2.4-alpine container) 12 | * Some example SSL certificate added and HTTPS supported for https://localhost.local and https://oxideshop.local domains 13 | * PHP 7.4 / 8.0 / 8.1 / 8.2 fpm (based on oxidesales/oxideshop-docker-php containers which use the official php:x.x-fpm containers as a base) with: 14 | * composer 2 15 | * xDebug 3 with remote debug and profiler preconfigured 16 | * error reporting enabled 17 | * MySQL 5.7 with adminer (original mysql container used) 18 | * Mailpit preconfigured to catch outgoing emails 19 | 20 | Additionally, check services directory: 21 | * Npm container preconfigured, so you can easily regenerate grunt/gulp/other builder assets for modules/themes easier (based on node:latest) 22 | * Chrome based selenium service available, for running your selenium tests (based on selenium/standalone-chrome-debug) 23 | * Elasticsearch (also kibana to manage it) containers preconfigured 24 | * NGINX container preconfigured to be used with our NGINX module 25 | * Sphinx container which allows you to regenerate and improve our documentations locally much easier 26 | * Redis container can be started and php extension will be automatically installed. Check the ``make addredisservice`` command in the Makefile 27 | 28 | ## Requirements 29 | 30 | * Docker (https://docs.docker.com/get-docker/) 31 | * Docker compose (https://docs.docker.com/compose/install/) 32 | * ``127.0.0.1 localhost.local`` - in your ``/etc/hosts`` file 33 | 34 | ## Quick start 35 | 36 | ``` 37 | git clone https://github.com/OXID-eSales/docker-eshop-sdk.git myProjectName 38 | cd myProjectName 39 | 40 | # get some information about whats possible 41 | make help 42 | 43 | # setup rights and basic configuration files 44 | make setup 45 | 46 | # run example script which prepares several example files for you to see this environment functionality 47 | make example 48 | ``` 49 | 50 | Access the website through the http://localhost.local 51 | * phpinfo shown on index page 52 | * example with database connection 53 | * example with email sending and catching it with mailpit 54 | * run the composer install on php container first. 55 | 56 | Adminer is available via http://localhost.local:8080 57 | * Server: mysql 58 | * Credentials: root/root 59 | 60 | Mailpit is available via http://localhost.local:8025/ 61 | 62 | ## Longer start 63 | 64 | This example shows more precise configuration which can be used for your project. It is real usage flow: 65 | 66 | ``` 67 | git clone https://github.com/OXID-eSales/docker-eshop-sdk.git myProjectName 68 | cd myProjectName 69 | 70 | # setup rights and basic configuration files 71 | make setup 72 | 73 | # add php, mysql and apache services (they are grouped in one command, but can be added separately if needed) 74 | make addbasicservices 75 | 76 | # add selenium container to the docker-compose 77 | make file=services/selenium-chrome.yml addservice 78 | 79 | # ensure you have source directory available, as its configured as webroot by default 80 | mkdir source 81 | 82 | # start everything 83 | make up 84 | 85 | # stop everything when its enough :) 86 | make down 87 | ``` 88 | 89 | ## Running php stuff 90 | 91 | We can connect to the php container and do the stuff in there: 92 | ``` 93 | make php 94 | php -v 95 | ``` 96 | 97 | Note: ``make php`` is just an alias for ``docker-compose exec php bash`` 98 | 99 | We can call commands directly without connecting to the container: 100 | ``` 101 | docker-compose run php php -v 102 | ``` 103 | 104 | ## Running npm commands 105 | 106 | ### Direct call 107 | ``` 108 | docker-compose run node npm install bootstrap 109 | ``` 110 | 111 | ### Connect to node container 112 | ``` 113 | make node 114 | ``` 115 | 116 | ### npm Install 117 | Assuiming you are already inside node container. You should run below command to install project dependencies. 118 | ``` 119 | npm install 120 | ``` 121 | 122 | ### Run Grunt 123 | 124 | Assuming that the Grunt has been installed and that the project has already been configured with a package.json then you should follow below steps after entering node container. 125 | 1. Change to the project's destination directory. 126 | 2. Install project dependencies with `npm install` 127 | 3. Run Grunt with command `npm run grunt` 128 | 129 | ## Further Troubleshooting 130 | 131 | When running the `npm install` command to install your project’s dependencies, the install process may hang. At that time installation hangs without any output. 132 | To resolve such issue run below-mentioned commands. 133 | ``` 134 | npm config rm proxy 135 | npm config rm https-proxy 136 | npm config set registry https://registry.npmjs.org/ 137 | npm install 138 | ``` 139 | 140 | ### Node.js/NPM install issues on MacBook M2/M3 (Apple Silicon) 141 | 142 | If you run `npm install` and node dependencies do not install (especially with errors related to PhantomJS or other native binaries), this is likely due to architecture differences: 143 | 144 | - By default, Docker on MacBook M2/M3 (Apple Silicon) uses the ARM64 architecture (`linux/arm64`). 145 | - Some older Node.js dependencies (like PhantomJS) only provide prebuilt binaries for x86_64 (`amd64`). 146 | - As a result, `npm install` may fail or binaries may not work as expected. 147 | 148 | **Solution:** 149 | 150 | Set the platform for the node container to `linux/amd64` in your `docker-compose.yml` and rebuild the container after the change. This forces Docker to emulate an Intel/amd64 environment, allowing npm to install and use x86_64-only binaries. 151 | 152 | **Example for docker-compose.yml:** 153 | 154 | ```yaml 155 | services: 156 | node: 157 | platform: linux/amd64 158 | # ...other config... 159 | ``` 160 | Rebuild your Docker containers: 161 | ```sh 162 | make down 163 | make up 164 | ``` 165 | 166 | After this change, re-run `npm install` inside the node container. The installation should now succeed, and binaries like PhantomJS will work as expected. 167 | 168 | ## Using Redis container 169 | 170 | In case Redis container is used, its possible to easily connect to the Redis console by using 171 | 172 | ``` 173 | docker compose exec redis redis-cli 174 | ``` 175 | 176 | ## Using Sphinx Container for Documentation Generation 177 | 178 | To generate documentation from documentation repositories locally, we have a preconfigured Sphinx container that can be utilized. 179 | 180 | To get started, ensure you import our Sphinx container service file using the following command: `make addsphinxservice`. Here's an example of how to use it: 181 | 182 | ``` 183 | # Clone shop developer documentation to source directory 184 | git clone https://github.com/OXID-eSales/developer_documentation source/docs 185 | 186 | # Add Sphinx container 187 | make docpath=./source/docs addsphinxservice 188 | ``` 189 | 190 | To regenerate the documentation, simply execute the command `make generate-docs`. After doing this, you'll find the generated documentation in the `source/docs/build directory`. 191 | 192 | 193 | ## Configurations 194 | 195 | ### Apache 196 | 197 | Custom configuration file: ``containers/httpd/project.conf``. 198 | 199 | ### SSL 200 | To setup SSL for HTTPS or HTTP/2, checkout the README.md in ``containers/https/certs``. 201 | 202 | ### PHP 203 | 204 | Select PHP version to be used in docker-compose php container configuration. 205 | Custom configuration file for php settings: ``containers/php/custom.ini``. 206 | 207 | ### Remote debugging with PHPSTORM 208 | 209 | * Configure the CLI Interpreter 210 | * Create a Server configuration and set mapping as source:/var/www/ 211 | 212 | ### Multiserver configuration 213 | 214 | The SDK contains basic configuration for a load balancing setup using nginx. Information for creating such a setup can be found in the [sdk recipes repository](https://github.com/OXID-eSales/docker-eshop-sdk-recipes?tab=readme-ov-file#multiserver-configuration). 215 | 216 | ## Issues and questions 217 | 218 | Feel free to make improvements for the SDK via Pull requests. 219 | 220 | Also, if there are problems with using it, consider creating the Issue in the "Issues" section of this repository on github. 221 | --------------------------------------------------------------------------------