GithubHelp home page GithubHelp logo

docker's Introduction

Sylius Docker Environment

🚨This project has been abandoned 🚨

Since Sylius-Standard v1.3.0 we are supporting Docker out of the box. Please use a default configuration for your end projects.

Build Status

This project is intended as boilerplate and for bootstrapping your 100% dockerized Sylius development environment. It can also be used as blueprint to use in an automated deployment pipeline achieving Dev/Prod-Parity.

The development environment consists of 3 containers, running

You can control, customize and extend the behaviour of this environment with make - see make help for details. It is built around the principles and ideas of the Docker Make Stub.

Development

Requirements

Because docker-compose.yml uses Compose file format 2.1 at least Docker version 1.12 ist required for this environment.

Quickstart

git clone https://github.com/sylius/docker sylius-docker
make help
make up
make console CMD=sylius:install

Accessing services and ports

Service Port Internal DNS Exported
Sylius (HTTP) 8000 sylius Yes
MySQL 3606 mysql Yes
MailHog (SMTP) 1025 mailhog No
MailHog (HTTP) 8025 mailhog Yes

Customizing docker-compose.yml

You can create a docker-compose.local.yml to further extend the docker-compose configuration by overloading the existing YAML configuration. If this file exists make up will recognize and add it as -f docker-compose.local.yml when executing docker-compose.

For example:

version: '2'

services:
  sylius:
    environments:
      - ADDITIONAL_ENV=yesplease

Please note array elements (ports, environments, volumes, ...) will get merged and not replaced. If you want to see this happen have a look at docker/compose#3939 and vote for this PR.

To change the e.g. exposed ports for your local environment you have to edit docker-compose.yml for now.

Running Symfony Console

You can always execute Symfony Console either by getting an interactive shell in the application container using make shell. For some a more convenient way might be using make console which is a wrapper for that.

When using the wrapper target you can pass arguments to console by using the CMD variable:

make console CMD=sylius:install
make console CMD="sylius:user:promote [email protected]"
make console CMD="sylius:theme:assets:install web --symlink --relative"

Support for you Deployment Pipeline

TODO

Todo

  • Integrate an Asset Builder
  • Run sylius:install when required
  • Run composer create-project when required (required for volume mount)
  • PR #15: Predefine project and network name (currently docker-compose generates one based on the root directory name)

docker's People

Contributors

castler avatar jverdeyen avatar lchrusciel avatar pamil avatar pjedrzejewski avatar tabsl avatar

Stargazers

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

Watchers

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

docker's Issues

Assets folder empty

Assets folder remain empty after install:

> make console CMD="assets:install web --symlink --relative"
docker exec \
        -ti \
        -u www-data \
        sylius-standard-app \
        sylius/bin/console assets:install web --symlink --relative

 Trying to install assets as relative symbolic links.

 --- ------------------------------ ------------------
      Bundle                         Method / Error
 --- ------------------------------ ------------------
  ✔   SonataCoreBundle               relative symlink
  ✔   WhiteOctoberPagerfantaBundle   relative symlink
 --- ------------------------------ ------------------


 [OK] All assets were successfully installed.

Then:

> make console CMD="sylius:theme:assets:install web --symlink --relative"
docker exec \
        -ti \
        -u www-data \
        sylius-standard-app \
        sylius/bin/console sylius:theme:assets:install web --symlink --relative
Trying to install assets as symbolic links.

But then:

> docker exec -ti -u www-data sylius-standard-app \
                        ls -l /var/www/sylius/web/assets/
total 0

[Documentation]

In README.md file,
this line docker exec -it $(docker-compose ps -q php) bash
can be simplified by docker-compose exec php bash

make up fails with post-install-cmd and parameters.yml.dist

Build fails with:

> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Creating the "app/config/parameters.yml" file
Script Incenteev\ParameterHandler\ScriptHandler::buildParameters handling the post-install-cmd event terminated with an exception


  [InvalidArgumentException]
  The top-level key parameters is missing.


run-script [--timeout TIMEOUT] [--dev] [--no-dev] [-l|--list] [--] [<script>] [<args>]...

ERROR: Service 'sylius' failed to build: The command '/bin/sh -c composer create-project                sylius/sylius-standard          ${SYLIUS_DIR}      ${SY
LIUS_VERSION}        && chmod +x sylius/bin/console  && cd sylius    && rm -f app/config/parameters.yml      && curl -o app/config/parameters.yml.dist https://
raw.githubusercontent.com/Sylius/Sylius-Standard/master/app/config/parameters.yml.dist    && composer run-script post-install-cmd' returned a non-zero code: 1
make: *** [Makefile:29: up] Error 1

Commenting two lines in the Dockerfile as in below git diff was a workaround:

diff --git a/Dockerfile b/Dockerfile
index f129e84..9207928 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -23,8 +23,8 @@ RUN composer create-project \
        && chmod +x sylius/bin/console \
        # Patch Sylius Standard from master (required for version < 1.1) \
        && cd sylius \
-       && rm -f app/config/parameters.yml \
-       && curl -o app/config/parameters.yml.dist https://raw.githubusercontent.com/Sylius/Sylius-Standard/master/app/config/parameters.yml.dist \
+#      && rm -f app/config/parameters.yml \
+#      && curl -o app/config/parameters.yml.dist https://raw.githubusercontent.com/Sylius/Sylius-Standard/master/app/config/parameters.yml.dist \
        && composer run-script post-install-cmd
 USER root

Images error 500

New to sylius the following error I can't get past, if I can't get images working I'm considering oscar

An example url
http://localhost:8000/app_dev.php/media/cache/resolve/sylius_shop_product_thumbnail/cb/94/d924f0a0093e349d5d697a728431.jpeg

500 Internal Server Error

Any ideas or pointers to why the images are not loading, following the URL gives

Unable to create image for path "a7/d9/b19a5df25abd2eebdafa2f1a0560.jpeg" and filter "sylius_shop_product_large_thumbnail". Message was "Unable to open image /var/www/sylius/web/media/image/a7/d9/b19a5df25abd2eebdafa2f1a0560.jpeg"

Do I need to set some liip settings in config?

Make up fails due to usermod and AS_UID

Step 7/15 : RUN usermod -u ${AS_UID} www-data
 ---> Running in e96f1ad881f5
usermod: UID '0' already exists
ERROR: Service 'sylius' failed to build: The command '/bin/sh -c usermod -u ${AS_UID} www-data' returned a non-zero code: 4

I use a standard installation.

Add support for BDD testing

I assume many have issues getting Behat including Selenium setup properly on their systems locally or on a Vagrant/Docker environment. It would be great to have a development Docker setup which runs similar tasks as being done on Travis (phpunit, phpspec, Behat, etc.) to allow smoother start of developing. When I started I found it rather hard to get it working. Would be great to have such functionality.

`sylius:install` command fails

After
make console CMD=sylius:install
I got

Loading sample data for environment dev.
Warning! This action will erase your database.
Continue? (y/N) y
 0/1 [░                           ]   0%

  [Doctrine\DBAL\Exception\InvalidFieldNameException]
  An exception occurred while executing 'INSERT INTO sylius_order_item (quantity, unit_price, units_total, adjust
  ments_total, total, is_immutable, order_id, product_name, variant_name, variant_id) VALUES (?, ?, ?, ?, ?, ?, ?
  , ?, ?, ?)' with params [2, 594, 60, 0, 60, 0, 1, "T-Shirt \"quia\"", "qui", 295]:
  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'product_name' in 'field list'

make command not found

I'm running Docker (Compose 1.21.1) in Windows 10 Pro, and "make" command doesn't seam to work:

make help
make : The term 'make' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
+CategoryInfo : ObjectNotFound: (make:String) [], CommandNotFoundException
+FullyQualifiedErrorId : CommandNotFoundException

Any help guys? Thanks!

Sylius project data in "host"

Same that #18

I'm adding docker-compose.local.yml to have the project data outside the container like this:

version: '2.1'

services:
   sylius:
     volumes:
       - ./sylius:/var/www/sylius

But, this does not work. I throw the error: File not found.

I'm only want:

###### docker-compose.yml

version: '3.1'

services:

  wordpress:
    image: wordpress
    restart: always
    ports:
      - 8080:80
    environment:
      WORDPRESS_DB_PASSWORD: example

  mysql:
    image: mysql:5.7
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: example

###### docker-compose.local.yml

version: '3.1'

services:

  wordpress:
    volumes:
      - ./app:/var/www/html

Make port configurable for MySQL (other ports too?)

ERROR: for mysql Cannot start service mysql: driver failed programming external connectivity on endpoint docker_mysql_1 (ad2d3430d8c5c83aba9633c20b10c4ebb7df8090bf6828b86072401e67c08173): Error starting userland proxy: Bind for 127.0.0.1:3306 failed: port is already allocated
ERROR: Encountered errors while bringing up the project."

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.