Closed denis-ev closed 4 years ago
You need an extra_hosts with your domain to 127.0.0.1. The Installer tries to communicate with himself
@shyim thanks for the fast response, I have
extra_hosts:
- "changedwebsite.com:127.0.0.1"
in the docker-compose file.
this is how the whole file looks like
#override defaults for dev
version: "3.7"
networks:
proxy_traefik:
external:
name: traefik_traefik
shopware6:
services:
app:
image: shopware-production:local
build: ./data
depends_on:
- mysql
- elasticsearch
networks:
- "proxy_traefik"
- "shopware6"
#ports:
# - 8000:8000
# - 8005:8000
extra_hosts:
- "changedwebsite.com:127.0.0.1"
environment:
- APP_ENV=dev
- APP_SECRET=appsecret
- APP_URL=https://changedwebsite.com
#- TRUSTED_PROXIES=127.0.0.1,127.0.0.2
#- TRUSTED_HOSTS=localhost,example.com
- MAILER_URL=null://localhost
- DATABASE_URL=mysql://shopware:mysqlpassword@changedwebsite_mysql_1:3306/shopware
- COMPOSER_HOME=/sw6/var/cache/composer
- INSTANCE_ID=instanceid
- BLUE_GREEN_DEPLOYMENT=1
- SHOPWARE_HTTP_CACHE_ENABLED=1
- SHOPWARE_HTTP_DEFAULT_TTL=7200
- SHOPWARE_ES_ENABLED=0
- SHOPWARE_ES_INDEXING_ENABLED=0
- SHOPWARE_ES_INDEX_PREFIX=sw
- SHOPWARE_CDN_STRATEGY_DEFAULT=id
volumes:
- "./data/config/jwt:/sw6/config/jwt"
- "./data/public/bundles:/sw6/public/bundles"
- "./data/public/media:/sw6/public/media"
- "./data/public/sitemap:/sw6/public/sitemap"
- "./data/public/theme:/sw6/public/theme"
- "./data/public/thumbnail:/sw6/public/thumbnail"
- "./data/var:/sw6/var"
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik_traefik"
- "traefik.http.services.changedwebsite.loadbalancer.server.scheme=http"
- "traefik.http.services.changedwebsite.loadbalancer.server.port=8000"
- "traefik.http.routers.changedwebsite-http.rule=Host(`changedwebsite.com`)"
- "traefik.http.routers.changedwebsite-http.entrypoints=http"
- "traefik.http.routers.changedwebsite-http.middlewares=redirect@file"
- "traefik.http.routers.changedwebsite.rule=Host(`changedwebsite.com`)"
- "traefik.http.routers.changedwebsite.entrypoints=https"
- "traefik.http.routers.changedwebsite.tls=true"
- "traefik.http.routers.changedwebsite.tls.domains[0].main=changedwebsite.com"
- "traefik.http.routers.changedwebsite.tls.certresolver=dns"
mysql:
image: mysql:5.7
hostname: mysql
networks:
- "shopware6"
environment:
- MYSQL_ROOT_PASSWORD= mysqlrootpassword
- MYSQL_DATABASE=shopware
- MYSQL_USER=shopware
- MYSQL_PASSWORD=mysqlpassword
volumes:
- "./mysql-data:/var/lib/mysql"
elasticsearch:
image: elastic/elasticsearch:7.1.1
networks:
- "shopware6"
environment:
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- discovery.type=single-node
Strange. But anyway this problem should not effect the shop. You can login using /admin into the shop
I can access /admin, but then I cannot login.
This is the error I get ... Something went wrong requesting "".
Can you access the recovery url? Maybe the installation hasn't completed yet
@soebbing
changedwebsite.com/recovery
forwards to http://changedwebsite.com:8000/recovery/
which won't work because it's behind a proxy
Edit: when I remove the port part, I get NGINX 403 forbidden
https://changedwebsite.com/recovery/install/
shows this
Der Installer wurde bereits ausgeführt.
Wenn Sie den Installationsvorgang erneut ausführen möchten, löschen Sie die Datei install.lock!
The installation process has already been finished.
If you want to run the installation process again, delete the file install.lock!
I've tested some more and found this.
XMLHttpRequest cannot load http://dev.doggo.kaufen/api/oauth/token due to access control checks.
@shyim @soebbing The problem was that I did not set up the trusted proxy, after that I can finally login. Thank you for the help and ideas.
@denis-ev
Would you share your traefik/shopware configuration? I have difficulties setting up shopware with docker-compose. I am currently getting a "Gateway Timeout"...
You would help me very much! :)
@sawden
Would you share your traefik/shopware configuration? I have difficulties setting up shopware with docker-compose. I am currently getting a "Gateway Timeout"...
You would help me very much! :)
docker-compose.yml
version: '3'
networks:
proxy_traefik:
external:
name: traefik_traefik
default:
services:
# Load Balancer / SSL / Web Server
placeholder:
image: webdevops/php-nginx:7.3
restart: unless-stopped
depends_on:
- db
networks:
- proxy_traefik
- default
volumes:
- ./web:/app
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik_traefik"
- "traefik.http.services.placeholder.loadbalancer.server.scheme=http"
- "traefik.http.services.placeholder.loadbalancer.server.port=80"
- "traefik.http.routers.placeholder-http.rule=Host(`placeholder`)"
- "traefik.http.routers.placeholder-http.entrypoints=http"
- "traefik.http.routers.placeholder-http.middlewares=redirect@file"
- "traefik.http.routers.placeholder.rule=Host(`placeholder `)"
- "traefik.http.routers.placeholder.entrypoints=https"
- "traefik.http.routers.placeholder.middlewares=doggode"
- "traefik.http.routers.placeholder.tls=true"
- "traefik.http.routers.placeholder.tls.domains[0].main=placeholder"
- "traefik.http.routers.placeholder.tls.domains[0].sans=*.placeholder"
- "traefik.http.routers.placeholder.tls.certresolver=dns"
environment:
VIRTUAL_HOST: placeholder
VIRTUAL_PORT: 80
WEB_DOCUMENT_INDEX: shopware.php
db:
image: mariadb
command: mysqld --sql_mode=""
container_name: db
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: "randompassword"
MYSQL_DATABASE: "databasename"
MYSQL_USER: "shop"
MYSQL_PASSWORD: "randompassword"
TZ: "Europe/Berlin"
volumes:
- ./mysql:/var/lib/mysql
- ./dump_new.sql:/docker-entrypoint-initdb.d/dump.sql
networks:
- default
ftp:
image: stilliard/pure-ftpd:hardened
restart: unless-stopped
environment:
- PUBLICHOST={{public ip}}
- FTP_USER_NAME=randomname
- FTP_USER_PASS=randompassword
- FTP_USER_HOME=/var/www/html
- FTP_USER_UID=1000
- FTP_USER_GID=1000
ports:
# active ftp
- "21:21"
# passive ftp ports, may differ if you configured them differently
- "30000-30009:30000-30009"
volumes:
- ./web:/var/www/html
traefik docker-compose.yml
version: '3'
networks:
traefik:
driver: bridge
services:
# Load Balancer / SSL / Web Server
traefik:
image: traefik:v2.3.1
restart: unless-stopped
networks:
traefik:
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /root/docker/traefik/traefik.yaml:/traefik.yaml
- /root/docker/traefik/acme.json:/acme.json
- /root/docker/traefik/conf.d/:/conf.d/
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik_traefik"
- "traefik.http.routers.traefik-http.rule=Host(`placeholder`)"
- "traefik.http.routers.traefik-http.entrypoints=http"
- "traefik.http.routers.traefik-http.middlewares=redirect@file"
- "traefik.http.routers.traefik.rule=Host(`placeholder`)"
- "traefik.http.routers.traefik.entrypoints=https"
- "traefik.http.routers.traefik.middlewares=basicAuth@file"
- "traefik.http.routers.traefik.tls=true"
- "traefik.http.routers.traefik.tls.domains[0].main=placeholder"
- "traefik.http.routers.traefik.tls.domains[0].sans=*.placeholder"
- "traefik.http.routers.traefik.tls.certresolver=dns"
- "traefik.http.routers.traefik.service=api@internal"
environment:
- CF_API_EMAIL=CLOUDFLAREEMAIL
- CF_API_KEY=PRIVATEKEYPLACEHOLDER
This is how I got it working, haven't had much time to improve it yet tho.
@sawden and in your shopware config.php the trusted proxies should be added ...
<?php
$_SERVER['HTTP_X_FORWARDED_PROTO'] = 'https';
return [
'db' => [
'host' => 'db',
'port' => '3306',
'username' => 'randomname',
'password' => 'randompassword',
'dbname' => 'randomdbname',
],
'trustedproxies' => [
'127.0.0.1',
'192.168.16.1' # depends on the ip of your traefik
],
];
@denis-ev You are the best! I've adjusted my configuration but I always get a 500 error at the end.
Since there is no documentary, this is how I proceeded:
version: '3'
networks: traefik: external: true example_shopware: services: example-shopware: image: webdevops/php-nginx:7.3 restart: unless-stopped depends_on:
example.de
)"example.de
)"2. Clone this repo
3. Create a .env with the following content
APP_ENV=dev APP_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx APP_URL=https://tearofjoy.de TRUSTED_PROXIES=127.0.0.1,192.168.96.3 MAILER_URL=null://localhost INSTANCE_ID= DATABASE_HOST=db DATABASE_URL=mysql://shopware:randompassword@db:3306/shopware
COMPOSER_HOME=/tmp/composer
BLUE_GREEN_DEPLOYMENT=1
SHOPWARE_ES_HOSTS= SHOPWARE_ES_ENABLED=0 SHOPWARE_ES_INDEXING_ENABLED=0 SHOPWARE_ES_INDEX_PREFIX= SHOPWARE_HTTP_CACHE_ENABLED=1 SHOPWARE_HTTP_DEFAULT_TTL=7200
INSTALL_LOCALE=de-DE
4. Run docker-compose up -d
5. Start the bash inside my "example-shopware_1" container and run `composer install` and `bin / console system: install --create-database --basic-setup`
6. Run ` chmod 0777 /app/var/*` because shopware can't create log files.
7. Load the page and get a "The server returned a "500 Internal Server Error".
Have I forgotten something? Maybe you have a helpful hint because otherwise I've got no more ideas.
Our traefik configs the same btw. :)!
Is there a timeframe when the docker image is not experimental anymore? I've been trying to set shop ware via docker up and I can get to the login screen but even when creating a new user via the cli I just cannot login.
Something went wrong requesting "".
Shopware is supposed to run behind Traefik, but when deleting all the data and retrying the setup via the web installation wizard I get to put in admin user etc, and then there is an error showing. The Error says