Coder Social home page Coder Social logo

magento2-docker's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

magento2-docker's Issues

SSL is failing the certificate

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

Default domain exception

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?

cron image stuck

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.