diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..49edf81 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,29 @@ +**/*.log +**/*.md +**/*.php~ +**/._* +**/.dockerignore +**/.DS_Store +**/.git/ +**/.gitattributes +**/.gitignore +**/.gitkeep +**/.gitmodules +**/Dockerfile +**/Thumbs.db +.editorconfig +.php_cs.cache +.travis.yml +composer.phar +docker-compose*.yaml +docker-compose*.yml +docker/mysql/data/ +etc/build/* +node_modules/ +var/* +vendor/ +public/assets/ +public/bundles/ +public/css/ +public/js/ +public/media diff --git a/.env b/.env index 335660e..ae53f84 100644 --- a/.env +++ b/.env @@ -17,20 +17,31 @@ APP_ENV=dev APP_DEBUG=1 APP_SECRET=67d829bf61dc5f87a73fd814e2c9f629 +APP_LOCALE=en_US ###< symfony/framework-bundle ### ###> doctrine/doctrine-bundle ### # Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url # For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db" # Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls -DATABASE_URL=mysql://root@127.0.0.1/app_name_%kernel.environment% +MYSQL_ROOT_PASSWORD=root +MYSQL_DATABASE=application_prod +MYSQL_USER=application +MYSQL_PASSWORD=application_passwd +MYSQL_HOST=mysql + +###> doctrine/doctrine-bundle ### +# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url +# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db" +# Configure your db driver and server_version in config/packages/doctrine.yaml +DATABASE_URL=mysql://$MYSQL_USER:$MYSQL_PASSWORD@$MYSQL_HOST:3306/$MYSQL_DATABASE ###< doctrine/doctrine-bundle ### ###> symfony/swiftmailer-bundle ### # For Gmail as a transport, use: "gmail://username:password@localhost" # For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode=" # Delivery is disabled by default via "null://localhost" -MAILER_URL=null://localhost +MAILER_URL=smtp://mailhog:1025 ###< symfony/swiftmailer-bundle ### ###> nelmio/cors-bundle ### diff --git a/.env.test b/.env.test index 5df76c6..ae9c305 100644 --- a/.env.test +++ b/.env.test @@ -1,3 +1,4 @@ APP_SECRET=67d829bf61dc5f87a73fd814e2c9f629 +MYSQL_DATABASE=application_test KERNEL_CLASS='App\Kernel' diff --git a/.travis.yml b/.travis.yml index f5299d3..d420b94 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,10 @@ env: - APP_ENV=test - APP_NAME_CACHE_DIR=$HOME/.app_name-cache - APP_NAME_BUILD_DIR=etc/build + - MYSQL_HOST=127.0.0.1 + - MYSQL_USER=root + - MYSQL_PASSWORD= + - MYSQL_DATABASE=application_test matrix: include: @@ -18,6 +22,46 @@ matrix: - TRAVIS_NODE_VERSION="7.5" services: - memcached + - + name: "Docker build" + + sudo: required + + env: + - DOCKER_COMPOSE_VERSION=1.22.0 + - APP_NAME_SUITE="docker" + + services: + - docker + + addons: + apt: + packages: + - docker-ce + + before_install: + # Install custom version of docker-composer + - sudo rm /usr/local/bin/docker-compose + - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose + - chmod +x docker-compose + - sudo mv docker-compose /usr/local/bin + + # Shutdown vanilla mysql + - sudo service mysql stop + - while sudo lsof -Pi :3306 -sTCP:LISTEN -t; do sleep 1; done + + script: + - id + - docker-compose --version + - docker-compose -f docker-compose.yml -f etc/travis/docker-compose.override.yml pull --ignore-pull-failures || true + - docker-compose -f docker-compose.yml -f etc/travis/docker-compose.override.yml build --pull + - docker-compose -f docker-compose.yml -f etc/travis/docker-compose.override.yml up -d + + - sleep 60 + + - docker-compose -f docker-compose.yml -f etc/travis/docker-compose.override.yml logs --no-color --tail=100000 + + - curl http://localhost/ - sudo: false php: 7.2 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f2fb2a9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,183 @@ +# the different stages of this Dockerfile are meant to be built into separate images +# https://docs.docker.com/compose/compose-file/#target + +ARG PHP_VERSION=7.3 +ARG NODE_VERSION=10 +ARG NGINX_VERSION=1.16 + +FROM scratch as scratch + +COPY . /code/ + +FROM php:${PHP_VERSION}-fpm-alpine AS application_php + +# persistent / runtime deps +RUN apk add --no-cache \ + acl \ + file \ + gettext \ + git \ + mariadb-client \ + shadow \ + ; + +ARG APCU_VERSION=5.1.17 +RUN set -eux; \ + apk add --no-cache --virtual .build-deps \ + $PHPIZE_DEPS \ + coreutils \ + freetype-dev \ + icu-dev \ + libjpeg-turbo-dev \ + libpng-dev \ + libtool \ + libwebp-dev \ + libzip-dev \ + mariadb-dev \ + zlib-dev \ + ; \ + \ + docker-php-ext-configure gd --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include --with-webp-dir=/usr/include --with-freetype-dir=/usr/include/; \ + docker-php-ext-configure zip --with-libzip; \ + docker-php-ext-install -j$(nproc) \ + exif \ + gd \ + intl \ + pdo_mysql \ + zip \ + ; \ + pecl install \ + apcu-${APCU_VERSION} \ + redis \ + ; \ + pecl clear-cache; \ + docker-php-ext-enable \ + apcu \ + opcache \ + redis \ + ; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-cache --virtual .application-phpexts-rundeps $runDeps; \ + \ + apk del .build-deps + +COPY --from=composer:latest /usr/bin/composer /usr/bin/composer +COPY --from=scratch code/docker/php/php.ini /usr/local/etc/php/php.ini +COPY --from=scratch code/docker/php/php-cli.ini /usr/local/etc/php/php-cli.ini +COPY --from=scratch code/docker/php/docker-entrypoint.sh /usr/local/bin/docker-entrypoint +RUN chmod +x /usr/local/bin/docker-entrypoint + +ARG USER_UID=1000 + +RUN usermod -u $USER_UID www-data -s /bin/sh + +USER www-data +WORKDIR /home/www-data + +RUN set -eux; \ + composer global require "hirak/prestissimo:^0.3" --prefer-dist --no-progress --no-suggest --classmap-authoritative; \ + composer clear-cache + +ENV PATH="${PATH}:/home/www-data/.composer/vendor/bin" + +# build for production +ARG APP_ENV=prod + +RUN mkdir /home/www-data/application + +WORKDIR /home/www-data/application + +# prevent the reinstallation of vendors at every changes in the source code +COPY --from=scratch --chown=www-data:www-data code/composer.json code/composer.lock code/symfony.lock ./ +RUN set -eux; \ + composer install --prefer-dist --no-autoloader --no-scripts --no-progress --no-suggest; \ + composer clear-cache + +# copy only specifically what we need +COPY --from=scratch --chown=www-data:www-data code/.env code/.env.test ./ +COPY --from=scratch --chown=www-data:www-data code/webpack.config.js ./ +COPY --from=scratch --chown=www-data:www-data code/assets assets/ +COPY --from=scratch --chown=www-data:www-data code/bin bin/ +COPY --from=scratch --chown=www-data:www-data code/config config/ +COPY --from=scratch --chown=www-data:www-data code/config config/ +COPY --from=scratch --chown=www-data:www-data code/public public/ +COPY --from=scratch --chown=www-data:www-data code/templates templates/ +COPY --from=scratch --chown=www-data:www-data code/translations translations/ + +RUN set -eux; \ + mkdir -p var/cache var/log; \ + composer dump-autoload --classmap-authoritative; \ + APP_SECRET='' composer run-script post-install-cmd; \ + chmod +x bin/console; sync; + +VOLUME /home/www-data/application/var + +ENTRYPOINT ["docker-entrypoint"] +CMD ["php-fpm"] + +FROM node:${NODE_VERSION}-alpine AS application_nodejs + +RUN set -eux; \ + apk add --no-cache --virtual .build-deps \ + g++ \ + gcc \ + git \ + make \ + python \ + shadow \ + ; + +COPY --from=scratch code/docker/nodejs/docker-entrypoint.sh /usr/local/bin/docker-entrypoint +RUN chmod +x /usr/local/bin/docker-entrypoint + +ARG USER_UID=1000 + +RUN usermod -u $USER_UID node + +USER node + +RUN mkdir /home/node/application +RUN mkdir /home/node/application/public + +WORKDIR /home/node/application + +COPY --from=scratch --chown=node:node code/package.json code/yarn.lock code/webpack.config.js ./ +COPY --from=scratch --chown=node:node code/assets assets/ +RUN set -eux; \ + yarn install; \ + yarn cache clean + +#COPY --from=scratch --from=application_php --chown=node:node /home/www-data/application/public public/ +COPY --from=application_php --chown=node:node /home/www-data/application/vendor/sylius/ui-bundle/Resources/private/ vendor/sylius/ui-bundle/Resources/private/ + +RUN set -eux; \ + NODE_ENV=prod yarn build + +ENTRYPOINT ["docker-entrypoint"] +CMD ["yarn", "dev"] + +FROM nginx:${NGINX_VERSION}-alpine AS application_nginx + +COPY --from=scratch code/docker/nginx/conf.d/default.conf /etc/nginx/conf.d/ + +WORKDIR /home/www-data/application/ + +COPY --from=application_php /home/www-data/application/public public/ +COPY --from=application_nodejs /home/node/application/public public/ + +FROM application_php as application_php_runtime + +USER www-data + +WORKDIR /home/www-data/application + +COPY --from=application_nodejs --chown=www-data:www-data /home/node/application/public public/ + +ENTRYPOINT ["docker-entrypoint"] +CMD ["php-fpm"] diff --git a/config/packages/framework.yaml b/config/packages/framework.yaml index 32ced8f..3372fb5 100644 --- a/config/packages/framework.yaml +++ b/config/packages/framework.yaml @@ -1,5 +1,5 @@ parameters: - locale: fr_FR + locale: '%env(resolve:APP_LOCALE)%' secret: '%env(resolve:APP_SECRET)%' framework: diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..8c15661 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,86 @@ +version: '3.4' + +services: + php: + build: + context: . + target: application_php_runtime + cache_from: + - monofony/symfonystarter-php:master + - monofony/symfonystarter-nodejs:master + - monofony/symfonystarter-nginx:master + args: + - USER_UID=1000 + image: monofony/symfonystarter-php:master + depends_on: + - mysql + environment: + - PHP_DATE_TIMEZONE=${PHP_DATE_TIMEZONE:-UTC} + volumes: + - .:/home/www-data/application:rw,cached + - ~/.ssh:/home/www-data/.ssh + - ~/.composer:/home/www-data/.composer + + mysql: + image: percona:5.7 + command: mysqld --sql_mode="" + env_file: + - .env + volumes: + - mysql-data:/var/lib/mysql:rw + ports: + - "3306:3306" + + nodejs: + build: + context: . + target: application_nodejs + cache_from: + - monofony/symfonystarter-php:master + - monofony/symfonystarter-nodejs:master + - monofony/symfonystarter-nginx:master + args: + - USER_UID=1000 + image: monofony/symfonystarter-nodejs:master + depends_on: + - php + environment: + - NODE_ENV=dev + - PHP_HOST=php + - PHP_PORT=9000 + volumes: + - .:/home/node/application:rw,cached + ports: + - "35729:35729" + - "8080:8080" + + nginx: + build: + context: . + target: application_nginx + cache_from: + - monofony/symfonystarter-php:master + - monofony/symfonystarter-nodejs:master + - monofony/symfonystarter-nginx:master + image: monofony/symfonystarter-nginx:master + depends_on: + - php + - nodejs + volumes: + - ./public:/home/www-data/application/public:ro + ports: + - "80:80" + + mailhog: + # do not use in production! + image: mailhog/mailhog:latest + environment: + - MH_STORAGE=maildir + volumes: + - mailhog-data:/maildir:rw + ports: + - "8025:8025" + +volumes: + mysql-data: + mailhog-data: diff --git a/docker/nginx/conf.d/default.conf b/docker/nginx/conf.d/default.conf new file mode 100644 index 0000000..2fb7f57 --- /dev/null +++ b/docker/nginx/conf.d/default.conf @@ -0,0 +1,40 @@ +server { + root /home/www-data/application/public; + + location / { + # try to serve file directly, fallback to index.php + try_files $uri /index.php$is_args$args; + } + + location ~ ^/index\.php(/|$) { + # Comment the next line and uncomment the next to enable dynamic resolution (incompatible with Kubernetes) + fastcgi_pass php:9000; + #resolver 127.0.0.11; + #set $upstream_host php; + #fastcgi_pass $upstream_host:9000; + + fastcgi_split_path_info ^(.+\.php)(/.*)$; + include fastcgi_params; + # When you are using symlinks to link the document root to the + # current version of your application, you should pass the real + # application path instead of the path to the symlink to PHP + # FPM. + # Otherwise, PHP's OPcache may not properly detect changes to + # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 + # for more information). + fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; + fastcgi_param DOCUMENT_ROOT $realpath_root; + # Prevents URIs that include the front controller. This will 404: + # http://domain.tld/index.php/some-path + # Remove the internal directive to allow URIs like this + internal; + } + + # return 404 for all other php files not matching the front controller + # this prevents access to other php files you don't want to be accessible. + location ~ \.php$ { + return 404; + } + + client_max_body_size 6m; +} diff --git a/docker/nodejs/docker-entrypoint.sh b/docker/nodejs/docker-entrypoint.sh new file mode 100644 index 0000000..c0a6b01 --- /dev/null +++ b/docker/nodejs/docker-entrypoint.sh @@ -0,0 +1,21 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- node "$@" +fi + +if [ "$1" = 'node' ] || [ "$1" = 'npm' ]; then + + >&2 echo "Waiting for PHP to be ready..." + until nc -z "$PHP_HOST" "$PHP_PORT"; do + sleep 1 + done +fi + +if [ "$APP_ENV" != 'prod' ]; then + yarn install +fi + +exec "$@" diff --git a/docker/php/docker-entrypoint.sh b/docker/php/docker-entrypoint.sh new file mode 100644 index 0000000..56d895a --- /dev/null +++ b/docker/php/docker-entrypoint.sh @@ -0,0 +1,29 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- php-fpm "$@" +fi + +if [ "$1" = 'php-fpm' ] || [ "$1" = 'bin/console' ]; then + mkdir -p var/cache var/log public/media + setfacl -R -m u:www-data:rwX -m u:"$(whoami)":rwX var public/media + setfacl -dR -m u:www-data:rwX -m u:"$(whoami)":rwX var public/media + + if [ "$APP_ENV" != 'prod' ]; then + composer install --prefer-dist --no-progress --no-suggest --no-interaction + bin/console assets:install --no-interaction + fi + + until bin/console doctrine:query:sql "select 1" >/dev/null 2>&1; do + (>&2 echo "Waiting for MySQL to be ready...") + sleep 1 + done + + if [ "$(ls -A src/Migrations/*.php 2> /dev/null)" ]; then + bin/console doctrine:migrations:migrate --no-interaction + fi +fi + +exec docker-php-entrypoint "$@" diff --git a/docker/php/php-cli.ini b/docker/php/php-cli.ini new file mode 100644 index 0000000..baba7ee --- /dev/null +++ b/docker/php/php-cli.ini @@ -0,0 +1,16 @@ +apc.enable_cli = 1 +date.timezone = ${PHP_DATE_TIMEZONE} +opcache.enable_cli = 1 +session.auto_start = Off +short_open_tag = Off + +# http://symfony.com/doc/current/performance.html +opcache.interned_strings_buffer = 16 +opcache.max_accelerated_files = 20000 +opcache.memory_consumption = 256 +realpath_cache_size = 4096K +realpath_cache_ttl = 600 + +memory_limit = 4G +post_max_size = 6M +upload_max_filesize = 5M diff --git a/docker/php/php.ini b/docker/php/php.ini new file mode 100644 index 0000000..dd08e3b --- /dev/null +++ b/docker/php/php.ini @@ -0,0 +1,15 @@ +apc.enable_cli = 1 +date.timezone = ${PHP_DATE_TIMEZONE} +opcache.enable_cli = 1 +session.auto_start = Off +short_open_tag = Off + +# http://symfony.com/doc/current/performance.html +opcache.interned_strings_buffer = 16 +opcache.max_accelerated_files = 20000 +opcache.memory_consumption = 256 +realpath_cache_size = 4096K +realpath_cache_ttl = 600 + +post_max_size = 6M +upload_max_filesize = 5M diff --git a/docs/cookbook/docker/index.rst b/docs/cookbook/docker/index.rst new file mode 100644 index 0000000..2d016e0 --- /dev/null +++ b/docs/cookbook/docker/index.rst @@ -0,0 +1,175 @@ +How to use Monofony with Docker +=============================== + +Docker eliminates the „works on my computer” issue by allowing you to run an application on the same environment configuration +on development, testing and production. You don't have to worry anymore if the PHP version is correct or if the MySQL +configuration won't put you in any trouble. + +Monofony is using a forked version of `SyliusStandard `_ docker configuration. +The differences are: + +- the php and node containers do not run as root, to avoid messing up permissions on the host + +- this fork uses a scratch container to hold the same context throughout the multistage build + + +System requirements +------------------- + +In order to get everything up and running, you should have installed on your system the following versions of Docker and +Docker Compose: + +.. code-block:: bash + + $ docker -v + Docker version 18.06.1-ce, build e68fc7a + + $ docker-compose -v + docker-compose version 1.24.0, build 0aa59064 + +Start working with Docker and Monofony +-------------------------------------- + +Next step is to clone the git repository on your local machine and then run the following commands: + +.. code-block:: bash + + $ docker-compose pull + +This will pull from the registry all required containers for you, so you can avoid building them locally and waste time +on that. + +Before actually bring the entire stack up, you should check your user and group id: + +.. code-block:: bash + + $ id + + uid=1000(my_user) gid=1000(my_user) groups=1000(my_user),4(adm),27(sudo),998(docker) + +The output of this command let's you see the current user id and groups that is member of. If your user id is different, +you should change it in ``docker-compose.yml`` - change the argument ``USER_UID`` + +If your user is not member of the docker group, you must run the commands with sudo in order to avoid errors. + +Now it's time to bring everything to life: + +.. code-block:: bash + + $ docker-compose up + +This will open all the containers defined in ``docker-compose.yml`` in the root folder of the cloned git repository. The +default file makes a few assumptions: + + - you are running a development environment + - you want certain ports to be exposed and available from your host (e.g. MySQL database) + - you want your application to actually send emails, through Mailhog, a SMTP fake server + - you want to keep a terminal with all the log output from the containers to make sure you spot errors if they happen + - it mounts ``~/.ssh`` and ``~/.composer`` to your containers to make your private ssh keys available, + in case you need to connect to any private repository and composer cached dependencies. + +If you want to start everything in background, you should run the command below: + +.. code-block:: bash + + $ docker-compose up -d + +Customization +------------- + +You can customize the docker by either modifying the ``docker-compose.yml`` file or by providing an override file. + +Create a file with the name ``docker-compose.override.yml`` in the root of your project and include the followings: + +.. code-block:: yaml + + version: '3.4' + + services: + php: + build: + args: + - USER_ID=2000 + + nodejs: + build: + args: + - USER_ID=2000 + +This will allow you to run the php and node containers with another user ID than the default one - 1000. Anything you write +in the override file differently than in the original file will supersede the later one. + +Your docker setup can also be influenced by setting some arguments or environments to different values: + +.. csv-table:: Arguments + :header: Value,Notes + + "ARG PHP_VERSION=7.3" + "ARG NODE_VERSION=10" + "ARG NGINX_VERSION=1.16" + "ARG APCU_VERSION=5.1.17" + "ARG USER_UID=1000" + "ARG APP_ENV=prod" + +All these arguments are taken into consideration on container build time. Any change to these variables will determine +Docker to rebuild the stack. + +PHP and Nginx configuration can be updated by editing the files from ``docker/php/`` or ``docker/nginx``. The ini files +contain the configuration for extensions, vhosts and everything you might need. + +Deploy the production environment +--------------------------------- + +This container system is almost ready for production environment as well. Once you have the images built locally or in CI, +you can push them to your own registry and deploy it from there. + +Get inspired on how to do this by observing the ``docker-compose.prod.yml`` file from `SyliusStandard `_ + +Using Gitlab for private docker registry +---------------------------------------- + +GitLab is offering unlimited private docker repository hosting. This means that if you want to avoid the hassles of building +your own registry infrastructure of if you want to test a private setup without committing to paid services, you should switch +to Gitlab to host your files and build your images with Gitlab CI. + +Below you can find a sample of GitLab CI configuration used to build Monofony docker containers and push them to a private +docker repository. + +.. code-block:: yaml + + stages: + - build + + docker: + stage: build + image: qmarketing/dind-docker-compose:18.09.5 + variables: + DOCKER_HOST: tcp://docker:2375/ + DOCKER_DRIVER: overlay2 + services: + - docker:dind + before_script: + - docker info + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com + - docker-compose pull + script: + - docker-compose build + - docker-compose push + +Gitlab CI is using docker to run the tests and you need to specify a docker in docker setup in order to get things going. +Because by default, the standard docker image is not providing ``docker-compose``, this image will use a community provided +docker image. Read more `here `_. + +Your contribution +----------------- + +This docker setup is far from perfect. It merely takes the work of the Sylius community and adds a little bit of improvement +to it. If you run Monofony and/or Sylius in production or if you use Docker to run the automated testing suite, feel free +to open a PR and contribute to this setup. + +This documentation currently lacks guidance on how to setup: + + - the docker environment with Symfony binary instead of NGINX + - how to do an actual deploy of the application with Docker (Swarm or Kubernetes) + - how to setup SSL certificates for local and production environment + - how to run this stack on Windows or MacOS and how to overcome platform specific issues diff --git a/docs/cookbook/docker/map.rst.inc b/docs/cookbook/docker/map.rst.inc new file mode 100644 index 0000000..45061c8 --- /dev/null +++ b/docs/cookbook/docker/map.rst.inc @@ -0,0 +1 @@ +* :doc:`/cookbook/docker/index` diff --git a/docs/cookbook/index.rst b/docs/cookbook/index.rst index cc0410f..383877e 100644 --- a/docs/cookbook/index.rst +++ b/docs/cookbook/index.rst @@ -49,3 +49,13 @@ Deployment deployment/capistrano .. include:: /cookbook/deployment/map.rst.inc + +Docker +---------- + +.. toctree:: + :hidden: + + docker/index + +.. include:: /cookbook/docker/map.rst.inc diff --git a/etc/travis/docker-compose.override.yml b/etc/travis/docker-compose.override.yml new file mode 100644 index 0000000..e214d74 --- /dev/null +++ b/etc/travis/docker-compose.override.yml @@ -0,0 +1,12 @@ +version: '3.4' + +services: + php: + build: + args: + - USER_UID=2000 + + nodejs: + build: + args: + - USER_UID=2000 diff --git a/package.json b/package.json index d76884f..34ebd6d 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ }, "scripts": { "build": "yarn encore production", - "dev": "yarn encore dev-server --hot", + "dev": "yarn encore dev-server --hot --host 0.0.0.0", "lint": "yarn lint:js", "lint:js": "eslint gulpfile.babel.js src/Sylius/Bundle/AdminBundle/gulpfile.babel.js src/Sylius/Bundle/ShopBundle/gulpfile.babel.js src/Sylius/Bundle/UiBundle/Resources/private/js src/Sylius/Bundle/AdminBundle/Resources/private/js src/Sylius/Bundle/ShopBundle/Resources/private/js" }, diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 4483a6c..3f75122 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -16,7 +16,7 @@ - +