-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from qenta-cee/SBUG-62
add docker-compose and setup scripts for v5.6.9 and v5.7.7 containers…
- Loading branch information
Showing
13 changed files
with
728 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
services: | ||
shopware_db: | ||
image: mysql:5.7 | ||
restart: always | ||
environment: | ||
MYSQL_ROOT_PASSWORD: ${SHOPWARE_DB_ROOTPASS:-ABC123} | ||
MYSQL_DATABASE: ${SHOPWARE_DB_NAME:-shopware} | ||
MYSQL_USER: ${SHOPWARE_DB_USER:-shopware} | ||
MYSQL_PASSWORD: ${SHOPWARE_DB_PASS:-shopware} | ||
cap_add: | ||
- SYS_NICE # CAP_SYS_NICE | ||
shopware: | ||
container_name: shopware | ||
build: | ||
context: docker/shopware/ | ||
dockerfile: ${SHOPWARE_VERSION:-v5-6-9}/Dockerfile | ||
depends_on: | ||
- shopware_db | ||
ports: | ||
- ${PORT_HTTP:-9800}:80 | ||
- ${PORT_SSL:-8443}:443 | ||
volumes: | ||
- ./:/tmp/plugin:ro | ||
environment: | ||
SHOPWARE_DB_HOST: ${SHOPWARE_DB_HOST:-shopware_db} | ||
SHOPWARE_DB_NAME: ${SHOPWARE_DB_NAME:-shopware} | ||
SHOPWARE_DB_USER: ${SHOPWARE_DB_USER:-shopware} | ||
SHOPWARE_DB_PASS: ${SHOPWARE_DB_PASS:-shopware} | ||
SHOPWARE_URL: ${SHOPWARE_URL:-localhost} | ||
NGROK_TOKEN: ${SHOPWARE_NGROK_TOKEN:-1vG3hzDLvtET960jZckDPnm966F_5E2EAQuTtrXDwcgRaDdEw} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
# BEGIN Shopware | ||
# The directives (lines) between "# BEGIN Shopware" and "# END Shopware" are dynamically generated. Any changes to the directives between these markers will be overwritten. | ||
|
||
<IfModule mod_rewrite.c> | ||
RewriteEngine on | ||
|
||
#RewriteBase /shopware/ | ||
|
||
# Fix for office 365 autodiscover feature to prevent CSRF errors | ||
RewriteRule ^autodiscover/autodiscover.xml$ - [F,L,NC] | ||
|
||
# HTTPS config for the backend asd | ||
RewriteCond %{HTTPS} !=on | ||
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | ||
|
||
RewriteRule shopware.dll shopware.php | ||
RewriteRule files/documents/.* engine [NC,L] | ||
RewriteRule backend/media/(.*) media/$1 [NC,L] | ||
RewriteRule custom/.*(config|menu|services|plugin)\.xml$ ./shopware.php?controller=Error&action=pageNotFoundError [NC,L] | ||
|
||
RewriteCond %{REQUEST_URI} !(\/(engine|files|templates|themes|web)\/) | ||
RewriteCond %{REQUEST_URI} !(\/media\/(archive|banner|image|music|pdf|unknown|video)\/) | ||
RewriteCond %{REQUEST_FILENAME} !-f | ||
RewriteCond %{REQUEST_FILENAME} !-d | ||
RewriteRule ^(.*)$ shopware.php [PT,L,QSA] | ||
|
||
# Fix missing authorization-header on fast_cgi installations | ||
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L] | ||
</IfModule> | ||
|
||
<IfModule mod_alias.c> | ||
# Restrict access to VCS directories | ||
RedirectMatch 404 /\\.(svn|git|hg|bzr|cvs)(/|$) | ||
|
||
# Restrict access to root folder files | ||
RedirectMatch 404 /(autoload\.php|composer\.(json|lock|phar)|README\.md|UPGRADE-(.*)\.md|CONTRIBUTING\.md|eula.*\.txt|\.gitignore|.*\.dist|\.env.*)$ | ||
|
||
# Restrict access to shop configs files | ||
RedirectMatch 404 /(web\/cache\/(config_\d+\.json|all.less))$ | ||
|
||
# Restrict access to theme configurations | ||
RedirectMatch 404 /themes/(.*)(.*\.lock|package\.json|\.gitignore|Gruntfile\.js|all\.less|node_modules\/.*)$ | ||
</IfModule> | ||
|
||
# Staging environment | ||
#SetEnvIf Host "staging.test.shopware.in" SHOPWARE_ENV=staging | ||
|
||
# Development environment | ||
#SetEnvIf Host "dev.shopware.in" SHOPWARE_ENV=dev | ||
#SetEnv SHOPWARE_ENV dev | ||
|
||
DirectoryIndex index.html | ||
DirectoryIndex index.php | ||
DirectoryIndex shopware.php | ||
|
||
# Disables download of configuration | ||
<Files ~ "\.(tpl|yml|ini)$"> | ||
# Deny all requests from Apache 2.4+. | ||
<IfModule mod_authz_core.c> | ||
Require all denied | ||
</IfModule> | ||
|
||
# Deny all requests from Apache 2.0-2.2. | ||
<IfModule !mod_authz_core.c> | ||
Deny from all | ||
</IfModule> | ||
</Files> | ||
|
||
# Enable gzip compression | ||
<IfModule mod_deflate.c> | ||
AddOutputFilterByType DEFLATE text/html text/xml text/plain text/css text/javascript application/javascript application/json application/font-woff application/font-woff2 image/svg+xml | ||
</IfModule> | ||
|
||
<Files ~ "\.(jpe?g|png|gif|css|js|woff|woff2|ttf|svg|webp|eot|ico)$"> | ||
<IfModule mod_expires.c> | ||
ExpiresActive on | ||
ExpiresDefault "access plus 1 month" | ||
</IfModule> | ||
|
||
<IfModule mod_headers.c> | ||
Header append Cache-Control "public" | ||
Header unset ETag | ||
</IfModule> | ||
|
||
FileETag None | ||
</Files> | ||
|
||
# Match generated files like: | ||
# 1429684458_t22_s1.css | ||
# 1429684458_t22_s1.js | ||
<FilesMatch "([0-9]{10})_(.+)\.(js|css)$"> | ||
<ifModule mod_headers.c> | ||
Header set Cache-Control "max-age=31536000, public" | ||
</ifModule> | ||
|
||
<IfModule mod_expires.c> | ||
ExpiresActive on | ||
ExpiresDefault "access plus 1 year" | ||
</IfModule> | ||
</FilesMatch> | ||
|
||
<IfModule mod_headers.c> | ||
<FilesMatch "\.(?i:svg)$"> | ||
Header set Content-Security-Policy "script-src 'none'" | ||
</FilesMatch> | ||
</IfModule> | ||
|
||
# Disables auto directory index | ||
<IfModule mod_autoindex.c> | ||
Options -Indexes | ||
</IfModule> | ||
|
||
<IfModule mod_negotiation.c> | ||
Options -MultiViews | ||
</IfModule> | ||
|
||
# AddType x-mapp-php7 .php | ||
# AddHandler x-mapp-php7.php | ||
|
||
<IfModule mod_headers.c> | ||
Header append X-Frame-Options SAMEORIGIN | ||
# Uncomment the following line to enable HSTS (https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security) and force clients to use HTTPS for at least one year (31536000 seconds) | ||
# Header always set Strict-Transport-Security "max-age=31536000" | ||
</IfModule> | ||
|
||
# END Shopware |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<VirtualHost *:80> | ||
|
||
ServerAdmin webmaster@localhost | ||
DocumentRoot /var/www/html | ||
|
||
RewriteCond %{SERVER_PORT} 80 | ||
RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] | ||
|
||
<Directory /var/www/html> | ||
AllowOverride All | ||
Options FollowSymLinks MultiViews | ||
Order allow,deny | ||
Allow from all | ||
</Directory> | ||
|
||
ErrorLog ${APACHE_LOG_DIR}/error.log | ||
CustomLog ${APACHE_LOG_DIR}/access.log combined | ||
|
||
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
which ngrok >/dev/null | ||
if [[ $? == 0 ]]; then | ||
NGROK_BINARY="$(which ngrok)" | ||
else | ||
>&2 echo "Installing NGROK" | ||
cd ~/ | ||
npm install ngrok >&2 | ||
NGROK_BINARY="./node_modules/ngrok/bin/ngrok" | ||
fi | ||
|
||
function get_ngrok_url() { | ||
curl --fail -s localhost:4040/api/tunnels | jq -r .tunnels\[0\].public_url | sed 's/^http:/https:/' | ||
} | ||
|
||
function wait_for_ngrok() { | ||
while [[ -z ${RESPONSE} || ${RESPONSE} == 'null' ]]; do | ||
RESPONSE=$(get_ngrok_url) | ||
sleep 1; | ||
done | ||
} | ||
|
||
[[ ${1} ]] && NGROK_TOKEN=${1} | ||
|
||
if [[ -z ${NGROK_TOKEN} ]]; then | ||
echo 'NGROK token missing. Set NGROK_TOKEN env' >&2 | ||
exit 1 | ||
fi | ||
|
||
${NGROK_BINARY} authtoken ${NGROK_TOKEN} >&/dev/null | ||
${NGROK_BINARY} http https://localhost:443 >&/dev/null & | ||
wait_for_ngrok | ||
NGROK_URL=$(get_ngrok_url) | ||
NGROK_HOST=$(sed 's,^https\?://,,' <<< ${NGROK_URL}) | ||
echo ${NGROK_HOST} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
header: | | ||
SHOPWARE Developer Version | ||
_ | ||
| | | ||
___| |__ ___ _ ____ ____ _ _ __ ___ | ||
/ __| '_ \ / _ \| '_ \ \ /\ / / _` | '__/ _ \ | ||
\__ \ | | | (_) | |_) \ V V / (_| | | | __/ | ||
|___/_| |_|\___/| .__/ \_/\_/ \__,_|_| \___| | ||
| | | ||
|_| | ||
paths: | ||
- dev-ops/common/actions | ||
|
||
templates: | ||
- source: "dev-ops/common/templates/build.properties" | ||
destination: "build/build.properties" | ||
- source: "dev-ops/common/templates/behat.yml.dist" | ||
destination: "tests/Mink/behat.yml" | ||
|
||
dynamic: | ||
USERKEY: echo "$(id -u):$(id -g)" | ||
APP_ID: docker-compose ps -q appserver | ||
MYSQL_ID: docker-compose ps -q app_mysql | ||
|
||
environments: | ||
docker: | ||
paths: | ||
- "dev-ops/docker/actions" | ||
templates: | ||
- source: "dev-ops/docker/docker-compose.override.yml" | ||
destination: "./docker-compose.override.yml" | ||
- source: "dev-ops/docker/templates/Dockerfile-app" | ||
destination: "dev-ops/docker/containers/app/Dockerfile" | ||
- source: "dev-ops/docker/templates/Dockerfile-mysql" | ||
destination: "dev-ops/docker/containers/mysql/Dockerfile" | ||
- source: "dev-ops/docker/templates/Dockerfile-elasticsearch" | ||
destination: "dev-ops/docker/containers/elasticsearch/Dockerfile" | ||
|
||
bamboo: | ||
paths: | ||
- "dev-ops/bamboo.shopware.com/actions" | ||
const: | ||
SW_HOST: "appserver" | ||
SW_BASE_PATH: "" | ||
templates: | ||
- source: "dev-ops/common/templates/build.properties" | ||
destination: "build/build.properties" | ||
- source: "dev-ops/common/templates/behat.yml.dist" | ||
destination: "tests/Mink/behat.yml" | ||
- source: "dev-ops/docker/templates/Dockerfile-app" | ||
destination: "dev-ops/docker/containers/app/Dockerfile" | ||
- source: "dev-ops/docker/templates/Dockerfile-mysql" | ||
destination: "dev-ops/docker/containers/mysql/Dockerfile" | ||
- source: "dev-ops/docker/templates/Dockerfile-elasticsearch" | ||
destination: "dev-ops/docker/containers/elasticsearch/Dockerfile" | ||
- source: "dev-ops/bamboo.shopware.com/docker-compose.override.yml" | ||
destination: "docker-compose.override.yml" | ||
dynamic: | ||
REVISION: echo "${SW_REVISION}" | ||
PARENT_REVISION: echo "${SW_PARENT_REVISION}" | ||
OCULAR_ACCESS_TOKEN: echo "${OCULAR_ACCESS_TOKEN}" |
Oops, something went wrong.