Skip to content

Commit 4304be0

Browse files
author
OXIDFabian
committed
Initial commit
0 parents  commit 4304be0

8 files changed

+285
-0
lines changed

.env

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# For Windows user
2+
# set the path to your project folder
3+
#PWD=C:\Users\fabian vogel\Downloads\OXID_Docker_Stack-master
4+
5+
## Shop settings
6+
# Shop Version 6.0, 6.1
7+
OXID_VERSION=6.1
8+
OXID_EDITION=ce
9+
10+
# Your OXID Serial
11+
OXID_SERIAL=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
12+
13+
# Demodata true or false
14+
OXID_DEMODATA=true
15+
16+
# Shopdomain
17+
DOMAIN=localhost
18+
19+
# httpd or nginx
20+
WEBSERVER=nginx
21+
22+
#memcached enabled true or false
23+
MEMCACHED=true
24+
25+
# Set ports
26+
WEBSERVER_PORT=80
27+
MAILHOG_PORT=8025
28+
ADMINER_PORT=8080
29+
30+
31+
# Set PHP version
32+
# PHP Versions 5.6-fpm, 7.0-fpm, 7.1-fpm, 7.2-fpm
33+
PHP_VERSION=7.1
34+
35+
36+
# DB Settings
37+
# MySQL Images mysql:5.5, mysql:5.6, mysql:5.7, mysql:8
38+
# MariaDB Images mariadb:5.5, mariadb:10.0, mariadb:10.1, mariadb:10.2, mariadb:10.3
39+
DB_IMAGE=mysql:5.7
40+
MYSQL_DATABASE=oxid
41+
MYSQL_USER=oxid
42+
MYSQL_PASSWORD=oxid
43+
MYSQL_ROOT_PASSWORD=root

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### Example user template template
3+
### Example user template
4+
5+
# IntelliJ project files
6+
.idea
7+
*.iml
8+
out
9+
gen
10+
/data

README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
**_OXID Docker Stack_**
2+
---
3+
_THIS IS A PRIVATE PROJECT AND NOT OFFICAL SUPPORTED BY OXID ESALES_
4+
5+
**Stack overview**
6+
7+
* Webserver container (httpd or nginx)
8+
* PHP container (7.0 - 7.3)
9+
* DB container (MySQL or MariaDB)
10+
* Memcached container
11+
* Mailhog container (default port: 8025)
12+
* Adminer container (default port: 8080)
13+
14+
**Quickstart**
15+
16+
install docker and docker-compose
17+
18+
download or git clone this repository
19+
20+
customize the .env file
21+
22+
* run `docker-compose up -d` to start the container stack
23+
24+
* open `http://localhost/` in your browser
25+
26+
27+
28+
**data persistence**
29+
30+
all data (_www_ and _mysql_) will be stored in the _data_ directory in your project folder
31+
32+
**XDEBUG**
33+
34+
set Debug Port in PHPStorm to 9001
35+
36+
Preferences -> Languages & Frameworks -> PHP -> Debug -> xdebug

auth.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"http-basic": {
3+
"professional-edition.packages.oxid-esales.com": {
4+
"username": "PE",
5+
"password": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
6+
},
7+
"enterprise-edition.packages.oxid-esales.com": {
8+
"username": "EE",
9+
"password": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
10+
},
11+
"erp.packages.oxid-esales.com": {
12+
"username": "erp",
13+
"password": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
14+
},
15+
"b2b-edition.packages.oxid-esales.com": {
16+
"username": "b2b",
17+
"password": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
18+
}
19+
}
20+
}

config/fastcgi_params.oxid

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
fastcgi_param SCRIPT_FILENAME /var/www/html/source$script_name;
2+
fastcgi_param QUERY_STRING $query_string;
3+
fastcgi_param REQUEST_METHOD $request_method;
4+
fastcgi_param CONTENT_TYPE $content_type;
5+
fastcgi_param CONTENT_LENGTH $content_length;
6+
7+
fastcgi_param SCRIPT_NAME $script_name;
8+
fastcgi_param REQUEST_URI $request_uri;
9+
fastcgi_param DOCUMENT_URI $document_uri;
10+
fastcgi_param DOCUMENT_ROOT $document_root;
11+
fastcgi_param SERVER_PROTOCOL $server_protocol;
12+
13+
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
14+
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
15+
16+
fastcgi_param REMOTE_ADDR $remote_addr;
17+
fastcgi_param REMOTE_PORT $remote_port;
18+
fastcgi_param SERVER_ADDR $server_addr;
19+
fastcgi_param SERVER_PORT $server_port;
20+
fastcgi_param SERVER_NAME $server_name;

config/shop.conf

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
server {
2+
listen 80;
3+
server_name _;
4+
5+
root /var/www/html/source;
6+
set $script_name $fastcgi_script_name;
7+
index index.php;
8+
9+
# Anfragen auf das Root Dokument auf die index.php leiten.
10+
# excact match = will immediately selected to serve the request independed of position
11+
# within this configuration file
12+
location = / {
13+
set $script_name /index.php;
14+
include conf.d/fastcgi_params.oxid;
15+
fastcgi_pass fcgi_php;
16+
}
17+
18+
# OXID eShop Setup: Prüfung auf "mod_rewrite".
19+
location = /oxseo.php {
20+
if ($args ~ "mod_rewrite_module_is=off") {
21+
rewrite /oxseo.php /oxseo.php?mod_rewrite_module_is=on? break;
22+
}
23+
24+
set $script_name oxseo.php;
25+
include conf.d/fastcgi_params.oxid;
26+
fastcgi_pass fcgi_php;
27+
}
28+
29+
# Im Admin und Setup wird kein Rewrite auf die oxseo.php benötigt.
30+
location ~ ^/(setup|admin)/?$ {
31+
set $script_name /$1/index.php;
32+
include conf.d/fastcgi_params.oxid;
33+
}
34+
35+
# Zugriff auf die internen Dateien und Apache's ".ht" Dateien verweigern.
36+
location ~ (/\.(ht|log$|tpl$)|^/pkg.rev$|^/(tmp|log)/) {
37+
deny all;
38+
}
39+
40+
location ~ /out/pictures/.*(\.jpg|\.gif|\.png)$ {
41+
# OXID 4.5.2 - 4.8.9
42+
#try_files $uri /core/utils/getimg.php;
43+
# OXID 4.9.0+
44+
try_files $uri /getimg.php;
45+
}
46+
47+
# im "out" Verzeichnis keine php ausfuehren.
48+
location ~ ^/out/ {
49+
}
50+
51+
# PHP-Dateien über PHP-FastCGI ausführen.
52+
location ~ \.php$ {
53+
# Zero-day exploit defense.
54+
# http://forum.nginx.org/read.php?2,88845,page=3
55+
try_files $uri =404;
56+
fastcgi_split_path_info ^(.+\.php)(/.+)$;
57+
include conf.d/fastcgi_params.oxid;
58+
fastcgi_pass fcgi_php;
59+
}
60+
61+
# SEO URLs die mit slash oder .html enden auf die oxseo.php leiten.
62+
location ~ (/|.html)$ {
63+
if (!-e $request_filename) {
64+
set $script_name /oxseo.php;
65+
fastcgi_pass fcgi_php;
66+
}
67+
include conf.d/fastcgi_params.oxid;
68+
}
69+
70+
}

config/upstreams.conf

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
upstream fcgi_php {
2+
server php:9000;
3+
}

docker-compose.yml

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
version: '3.7'
2+
3+
services:
4+
5+
db:
6+
image: ${DB_IMAGE}
7+
restart: always
8+
volumes:
9+
- ${PWD}/data/mysql/:/var/lib/mysql
10+
ports:
11+
- "3306:3306"
12+
environment:
13+
MYSQL_DATABASE: ${MYSQL_DATABASE}
14+
MYSQL_USER: ${MYSQL_USER}
15+
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
16+
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
17+
TZ: Europe/Berlin
18+
networks:
19+
- internal
20+
21+
php:
22+
image: oxidfabian/oxid-php:${PHP_VERSION}
23+
restart: always
24+
volumes:
25+
- ${PWD}/data/www/:/var/www/html/:cached
26+
- ${PWD}/auth.json:/tmp/auth.json
27+
depends_on:
28+
- db
29+
networks:
30+
- internal
31+
environment:
32+
DOMAIN: ${DOMAIN}
33+
OXID_VERSION: ${OXID_VERSION}
34+
OXID_EDITION: ${OXID_EDITION}
35+
OXID_DEMODATA: ${OXID_DEMODATA}
36+
MYSQL_HOST: db
37+
MYSQL_DATABASE: ${MYSQL_DATABASE}
38+
MYSQL_USER: ${MYSQL_USER}
39+
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
40+
MEMCACHED: ${MEMCACHED}
41+
XDEBUG_CONFIG: idekey=PHPSTORM
42+
43+
webserver:
44+
image: ${WEBSERVER}
45+
restart: always
46+
hostname: ${DOMAIN}
47+
depends_on:
48+
- php
49+
volumes:
50+
- ${PWD}/data/www/:/var/www/html/:cached
51+
- ${PWD}/config/shop.conf:/etc/nginx/conf.d/default.conf
52+
- ${PWD}/config/fastcgi_params.oxid:/etc/nginx/conf.d/fastcgi_params.oxid
53+
- ${PWD}/config/upstreams.conf:/etc/nginx/conf.d/upstreams.conf
54+
ports:
55+
- ${WEBSERVER_PORT}:80
56+
networks:
57+
internal:
58+
aliases:
59+
- ${DOMAIN}
60+
61+
mailhog:
62+
image: mailhog/mailhog:latest
63+
restart: always
64+
ports:
65+
- ${MAILHOG_PORT}:8025
66+
networks:
67+
- internal
68+
69+
memcached:
70+
image: memcached:alpine
71+
networks:
72+
- internal
73+
74+
adminer:
75+
image: adminer
76+
restart: always
77+
ports:
78+
- ${ADMINER_PORT}:8080
79+
networks:
80+
- internal
81+
82+
networks:
83+
internal:

0 commit comments

Comments
 (0)