zsoerenm / magento2-docker Goto Github PK
View Code? Open in Web Editor NEWA composition of Docker containers for development and production
License: MIT License
A composition of Docker containers for development and production
License: MIT License
logs showing :
sslproxy_1 | [emerg] 1#1: PEM_read_bio_X509_AUX("/etc/nginx/ssl/nginx.crt") failed (SSL: error:0906D06C:PEM routines:PEM_read_bio:no start line:Expecting: TRUSTED CERTIFICATE)
yet i've created the certificate and the key and add it to the certs folder
using
openssl req -x509 -sha256 -nodes -newkey rsa:2048 -days 365 -keyout localhost.key -out localhost.crt
HI @zsoerenm
I appreciate the tremendous work that you achieved to setup magento over docker containers. I have one issue trying to solve that raise during both build and run stages. I included all the needed app files from magento to the docker volume mount under php containers, and update the mariadb database with the needed data:
version: '3'
services:
sslproxy:
build:
context: .
dockerfile: sslproxy/Dockerfile
depends_on:
- varnish
ports:
- "443:443"
- "80:80"
volumes:
- ./certs/localhost+2-key.pem:/etc/nginx/ssl/nginx.key
- ./certs/localhost+2.pem:/etc/nginx/ssl/nginx.crt
environment:
- BACKEND_HOST=varnish
- SERVER_NAME=localhost
varnish:
image: zsoerenm/magento2-varnish:2.2.6
depends_on:
- web
redis:
image: redis:alpine
web:
build:
context: .
dockerfile: nginx/Dockerfile
depends_on:
- php
volumes:
- mediadata:/var/www/html/pub/media:ro
- appdata:/var/www/html:ro
# - ./src/app/code:/var/www/html/app/code:ro
# - ./src/vendor/<some_vendor>:/var/www/html/vendor/<some_vendor>:ro
environment:
- BACKEND_HOST=php
- SERVER_NAME=web
php:
build:
context: .
dockerfile: php/Dockerfile
depends_on:
- db
volumes:
- ./src/app:/var/www/html/app
# - mediadata:/var/www/html/pub/media
# - configdata:/var/www/html/app/etc
# - appdata:/var/www/html
# - ./src/vendor/<some_vendor>:/var/www/html/vendor/<some_vendor>
environment:
- DEFAULT_CACHE_REDIS_SERVER=redis
- DEFAULT_CACHE_REDIS_DATABASE=1
- PAGE_CACHE_REDIS_SERVER=redis
- PAGE_CACHE_REDIS_DATABASE=2
- SESSION_REDIS_SERVER=redis
- SESSION_REDIS_DATABASE=3
db:
image: mariadb:10.2
volumes:
- dbdata:/var/lib/mysql
healthcheck:
test: 'mysqladmin ping --silent'
environment:
- MYSQL_ROOT_PASSWORD=magento2
- MYSQL_DATABASE=magento2
- MYSQL_USER=magento2
- MYSQL_PASSWORD=magento2
cron:
image: zsoerenm/magento2-php:2.2.6
depends_on:
- db
volumes:
- mediadata:/var/www/html/pub/media
- configdata:/var/www/html/app/etc
- appdata:/var/www/html
entrypoint: "su magento -s /bin/sh -c 'trap exit TERM; while :; do bin/magento cron:run; sleep 1m & wait $${!}; done;'"
volumes:
dbdata:
appdata:
mediadata:
configdata:
The app folders include all needed folder to setup my app code, design and etc folders
and the etc folder include all the needed configuration env.php, config.php
and finally update php docker file to enable all plugins:
....
&& php bin/magento module:enable --all \
&& php bin/magento setup:di:compile \
&& php bin/magento setup:static-content:deploy -f -q -j=2 \
....
However for some reason i hit an error related to default website is not defined:
+ php bin/magento setup:di:compile
Compilation was started.
%message% 0/7 [>---------------------------] 0% < 1 sec 34.0 MiB%message% 0/7 [>---------------------------] 0% < 1 sec 34.0 MiBProxies code generation... 0/7 [>------------------------] 0% < 1 sec 34.0 MiB
Proxies code generation... 1/7 [===>---------------------] 14% < 1 sec 40.0 MiB
Repositories code generation... 1/7 [==>-----------------] 14% < 1 sec 40.0 MiB
Repositories code generation... 2/7 [=====>--------------] 28% 9 secs 114.0 MiB
Service data attributes generation... 2/7 [====>---------] 28% 9 secs 114.0 MiB
Service data attributes generation... 3/7 [=====>-------] 42% 10 secs 114.0 MiB
Application code generator... 3/7 [=====>-------] 42% 10 secs 114.0 MiB
Application code generator... 4/7 [=======>-----] 57% 20 secs 130.0 MiB
Interceptors generation... 4/7 [=======>-----] 57% 20 secs 130.0 MiB
Interceptors generation... 5/7 [=========>---] 71% 42 secs 160.0 MiB
Area configuration aggregation... 5/7 [=========>---] 71% 42 secs 160.0 MiB
Area configuration aggregation... 6/7 [===========>-] 85% 51 secs 252.0 MiB
Interception cache generation... 6/7 [===========>-] 85% 51 secs 252.0 MiB
Interception cache generation... 7/7 [=============] 100% 56 secs 252.0 MiB
Generated code and dependency injection configuration successfully.
+ php bin/magento setup:static-content:deploy -f -q '-j=2'
In WebsiteRepository.php line 159:
The default website isn't defined. Set the website and try again.
, apply some changes to enable default_store within the database per this thread, but with no success.
Any idea on what could be the root cause for such problem? or could you point to some approach to debug it?
logging is showing :
db_1 | 2019-07-01 13:48:43 140675136968448 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
running docker-compose up in my machine results in the following output:
ron_1 | [Symfony\Component\Console\Exception\CommandNotFoundException]
cron_1 | There are no commands defined in the "cron" namespace.
cron_1 |
cron_1 | Did you mean this?
cron_1 | setup:cron
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.