├── dist └── dev │ ├── config │ └── packages │ │ └── swiftmailer.yaml │ ├── .env │ ├── .env.dist │ ├── .env.prod.dist │ ├── .env.test.dist │ └── .env.test_cached.dist ├── .gitignore ├── infra └── dev │ ├── node │ └── Dockerfile │ ├── elasticsearch │ └── Dockerfile │ └── docker-compose.yml ├── resources └── makefiles │ ├── application.mk │ ├── help.mk │ ├── test.mk │ ├── theming.mk │ ├── composer.mk │ ├── docker.mk │ ├── symfony.mk │ └── sylius.mk ├── README.md └── Makefile /dist/dev/config/packages/swiftmailer.yaml: -------------------------------------------------------------------------------- 1 | #swiftmailer: 2 | # url: '%env(MAILER_URL)%' 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Caches and co. 2 | /.bash* 3 | /.vim* 4 | /.cache* 5 | /.composer 6 | /.config* 7 | /.yarn* 8 | /.v8flags* 9 | /apps/* 10 | /.babel.json 11 | .php-version 12 | -------------------------------------------------------------------------------- /infra/dev/node/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:8 2 | 3 | # Use app user 4 | ARG USER_UID=1000 5 | RUN usermod -u 65533 node 6 | RUN usermod -u $USER_UID www-data 7 | 8 | WORKDIR /var/www 9 | 10 | USER www-data 11 | -------------------------------------------------------------------------------- /infra/dev/elasticsearch/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM docker.elastic.co/elasticsearch/elasticsearch:7.4.0 2 | 3 | # Install ES plugins 4 | RUN bin/elasticsearch-plugin install analysis-phonetic 5 | RUN bin/elasticsearch-plugin install analysis-icu 6 | -------------------------------------------------------------------------------- /resources/makefiles/application.mk: -------------------------------------------------------------------------------- 1 | ### APPLICATION 2 | # ¯¯¯¯¯¯¯¯¯¯¯¯¯ 3 | 4 | app.start: symfony.domain.attach docker.up symfony.server.start ## Start the application 5 | 6 | app.stop: docker.stop symfony.server.stop ## Stop the application 7 | 8 | app.cache.clean: sylius.cache.clean ## Clean cache 9 | -------------------------------------------------------------------------------- /resources/makefiles/help.mk: -------------------------------------------------------------------------------- 1 | ### OTHERS 2 | # ¯¯¯¯¯¯¯¯ 3 | 4 | .PHONY: help 5 | help: ## Dislay this help 6 | @IFS=$$'\n'; for line in `grep -h -E '^[a-zA-Z_#-]+:?.*?## .*$$' $(MAKEFILE_LIST)`; do if [ "$${line:0:2}" = "##" ]; then \ 7 | echo $$line | awk 'BEGIN {FS = "## "}; {printf "\n\033[33m%s\033[0m\n", $$2}'; else \ 8 | echo $$line | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-40s\033[0m %s\n", $$1, $$2}'; fi; \ 9 | done; unset IFS; 10 | 11 | -------------------------------------------------------------------------------- /resources/makefiles/test.mk: -------------------------------------------------------------------------------- 1 | ### TESTING 2 | # ¯¯¯¯¯¯¯¯¯ 3 | 4 | TEST_ENV=test 5 | 6 | test: test-install test-phpunit ## Run all tests 7 | 8 | test.install: ## Install test environment 9 | ${MAKE} APP_ENV=${TEST_ENV} project.install 10 | 11 | test.run: test.composer test.phpunit ## Run all tests 12 | 13 | .PHONY: test.composer 14 | test.composer: ## Validate composer.json 15 | $(call symfony.composer,validate --strict) 16 | 17 | test.phpunit: ## Run PHPUnit tests 18 | $(call symfony,php bin/phpunit || true) 19 | -------------------------------------------------------------------------------- /resources/makefiles/theming.mk: -------------------------------------------------------------------------------- 1 | ### THEMING 2 | # ¯¯¯¯¯¯¯¯¯ 3 | 4 | theme.install: theme.yarn.install theme.build theme.assets.install ## Install everything we need to run theme commands 5 | 6 | theme.build: ## Build the theme using gulp 7 | $(call docker-compose,run -u www-data --entrypoint /bin/bash node -c "cd apps/${SYLIUS_FOLDER}; yarn run gulp") 8 | 9 | theme.yarn.install: ## Install yarn dependencies 10 | $(call docker-compose,run --rm -u www-data --entrypoint /bin/bash node -c "cd apps/${SYLIUS_FOLDER}; yarn install") 11 | 12 | theme.assets.install: sylius.theme.assets.install ## Install theme(s) assets 13 | -------------------------------------------------------------------------------- /resources/makefiles/composer.mk: -------------------------------------------------------------------------------- 1 | ### COMPOSER 2 | # ¯¯¯¯¯¯¯¯¯¯ 3 | 4 | composer.create-project: ## Run composer create projet 5 | (symfony composer create-project sylius/sylius-standard apps/${SYLIUS_FOLDER}) 6 | 7 | composer.install: ## Run composer install 8 | $(call symfony.composer,install -o --prefer-source) 9 | 10 | composer.install.dist: ## Run composer install (prefer dist) 11 | $(call symfony.composer,install -o --prefer-dist) 12 | 13 | composer.install.dist.no-interaction: ## Run composer install (prefer dist, no interaction) 14 | $(call symfony.composer,install -o --prefer-dist -n) 15 | 16 | composer.install.no-script: ## Run composer install without scripts 17 | $(call symfony.composer,install -o --prefer-source --no-scripts) 18 | 19 | composer.autoload.dump: ## Dump Composer autoload (optimized) 20 | $(call symfony.composer,dump -o) 21 | 22 | composer.self-update: ## Dump Composer autoload (optimized) 23 | $(call symfony.composer,self-update) 24 | -------------------------------------------------------------------------------- /dist/dev/.env: -------------------------------------------------------------------------------- 1 | # This file is a "template" of which env vars needs to be defined in your configuration or in an .env file 2 | # Set variables here that may be different on each deployment target of the app, e.g. development, staging, production. 3 | # https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration 4 | 5 | ###> symfony/framework-bundle ### 6 | APP_ENV=dev 7 | APP_DEBUG=1 8 | APP_SECRET=MonsieurBiz 9 | ###< symfony/framework-bundle ### 10 | 11 | ###> doctrine/doctrine-bundle ### 12 | # Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url 13 | # For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db" 14 | # Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls 15 | DATABASE_URL=mysql://root:root@127.0.0.1/sylius_%kernel.environment% 16 | ###< doctrine/doctrine-bundle ### 17 | 18 | ###> symfony/swiftmailer-bundle ### 19 | # For Gmail as a transport, use: "gmail://username:password@localhost" 20 | # For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode=" 21 | # Delivery is disabled by default via "null://localhost" 22 | MAILER_URL=smtp://mail 23 | ###< symfony/swiftmailer-bundle ### 24 | -------------------------------------------------------------------------------- /dist/dev/.env.dist: -------------------------------------------------------------------------------- 1 | # This file is a "template" of which env vars needs to be defined in your configuration or in an .env file 2 | # Set variables here that may be different on each deployment target of the app, e.g. development, staging, production. 3 | # https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration 4 | 5 | ###> symfony/framework-bundle ### 6 | APP_ENV=dev 7 | APP_DEBUG=1 8 | APP_SECRET=MonsieurBiz 9 | ###< symfony/framework-bundle ### 10 | 11 | ###> doctrine/doctrine-bundle ### 12 | # Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url 13 | # For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db" 14 | # Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls 15 | DATABASE_URL=mysql://root:root@127.0.0.1/sylius_%kernel.environment% 16 | ###< doctrine/doctrine-bundle ### 17 | 18 | ###> symfony/swiftmailer-bundle ### 19 | # For Gmail as a transport, use: "gmail://username:password@localhost" 20 | # For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode=" 21 | # Delivery is disabled by default via "null://localhost" 22 | MAILER_URL=smtp://mail 23 | ###< symfony/swiftmailer-bundle ### 24 | -------------------------------------------------------------------------------- /dist/dev/.env.prod.dist: -------------------------------------------------------------------------------- 1 | # This file is a "template" of which env vars needs to be defined in your configuration or in an .env file 2 | # Set variables here that may be different on each deployment target of the app, e.g. development, staging, production. 3 | # https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration 4 | 5 | ###> symfony/framework-bundle ### 6 | APP_ENV=prod 7 | APP_DEBUG=0 8 | APP_SECRET=MonsieurBiz 9 | ###< symfony/framework-bundle ### 10 | 11 | ###> doctrine/doctrine-bundle ### 12 | # Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url 13 | # For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db" 14 | # Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls 15 | DATABASE_URL=mysql://root:root@127.0.0.1/sylius_%kernel.environment% 16 | ###< doctrine/doctrine-bundle ### 17 | 18 | ###> symfony/swiftmailer-bundle ### 19 | # For Gmail as a transport, use: "gmail://username:password@localhost" 20 | # For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode=" 21 | # Delivery is disabled by default via "null://localhost" 22 | MAILER_URL=smtp://mail 23 | ###< symfony/swiftmailer-bundle ### 24 | -------------------------------------------------------------------------------- /dist/dev/.env.test.dist: -------------------------------------------------------------------------------- 1 | # This file is a "template" of which env vars needs to be defined in your configuration or in an .env file 2 | # Set variables here that may be different on each deployment target of the app, e.g. development, staging, production. 3 | # https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration 4 | 5 | ###> symfony/framework-bundle ### 6 | APP_ENV=test 7 | APP_DEBUG=1 8 | APP_SECRET=MonsieurBiz 9 | ###< symfony/framework-bundle ### 10 | 11 | ###> doctrine/doctrine-bundle ### 12 | # Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url 13 | # For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db" 14 | # Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls 15 | DATABASE_URL=mysql://root:root@127.0.0.1/sylius_%kernel.environment% 16 | ###< doctrine/doctrine-bundle ### 17 | 18 | ###> symfony/swiftmailer-bundle ### 19 | # For Gmail as a transport, use: "gmail://username:password@localhost" 20 | # For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode=" 21 | # Delivery is disabled by default via "null://localhost" 22 | MAILER_URL=smtp://mail 23 | ###< symfony/swiftmailer-bundle ### 24 | -------------------------------------------------------------------------------- /dist/dev/.env.test_cached.dist: -------------------------------------------------------------------------------- 1 | # This file is a "template" of which env vars needs to be defined in your configuration or in an .env file 2 | # Set variables here that may be different on each deployment target of the app, e.g. development, staging, production. 3 | # https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration 4 | 5 | ###> symfony/framework-bundle ### 6 | APP_ENV=test_cached 7 | APP_DEBUG=0 8 | APP_SECRET=MonsieurBiz 9 | ###< symfony/framework-bundle ### 10 | 11 | ###> doctrine/doctrine-bundle ### 12 | # Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url 13 | # For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db" 14 | # Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls 15 | DATABASE_URL=mysql://root:root@127.0.0.1/sylius_%kernel.environment% 16 | ###< doctrine/doctrine-bundle ### 17 | 18 | ###> symfony/swiftmailer-bundle ### 19 | # For Gmail as a transport, use: "gmail://username:password@localhost" 20 | # For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode=" 21 | # Delivery is disabled by default via "null://localhost" 22 | MAILER_URL=smtp://mail 23 | ###< symfony/swiftmailer-bundle ### 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Sylius Infra Project 2 | 3 | A Sylius infra using the Symfony binary. 4 | 5 | If you want to know more about the Symfony binary, you can this read this [fantastic article from Jolicode](https://jolicode.com/blog/my-local-server-with-the-symfony-binary) 6 | 7 | Else you can use the [full docker infra](https://github.com/monsieurbiz/sylius-infra/tree/full-docker) 8 | 9 | ## Help 10 | 11 | Use `make` or `make help` to get the list of available commands. 12 | 13 | ## Installation 14 | 15 | ``` 16 | git clone git@github.com:monsieurbiz/sylius-infra.git 17 | cd sylius-infra 18 | rm -rf .git 19 | git init 20 | git add . 21 | git commit -m "Init project with Sylius infra" 22 | make add-symfony-bin 23 | sudo cp ${HOME}/.symfony/bin/symfony /usr/local/bin/ 24 | make coffee 25 | ``` 26 | 27 | Enjoy ☕️ 28 | 29 | You'll find: 30 | 31 | - Your website at `http://sylius-store.wip`. 32 | - Admin panel at `http://sylius-store.wip/admin` (Login : `sylius`, password: `sylius`). 33 | - Your mails at `http://localhost:1080`. 34 | 35 | ### Up containers 36 | 37 | `make up` 38 | 39 | ### Down containers 40 | 41 | `make down` 42 | 43 | ## Change Sylius folder dir 44 | 45 | You can to change the target dir (`apps/sylius` by default): 46 | 47 | ``` 48 | make SYLIUS_FOLDER=foo coffee 49 | ``` 50 | 51 | This command will create your Sylius shop in `apps/foo`. 52 | -------------------------------------------------------------------------------- /resources/makefiles/docker.mk: -------------------------------------------------------------------------------- 1 | ### DOCKER 2 | # ¯¯¯¯¯¯¯¯ 3 | 4 | define docker-compose 5 | cd ${DC_DIR} && docker-compose -p ${DC_PREFIX} $(1) 6 | endef 7 | 8 | docker.pull: ## Pull the external images 9 | $(call docker-compose,pull) 10 | 11 | docker.build: PULL_FROM=0 12 | docker.build: ## Build the containers 13 | ifeq ($(PULL_FROM),1) 14 | $(call docker-compose,build --pull) 15 | else 16 | $(call docker-compose,build) 17 | endif 18 | 19 | docker.up: ## Up the containers 20 | $(call docker-compose,up -d) 21 | 22 | docker.down: ## Down the containers (keep volumes) 23 | $(call docker-compose,down) 24 | 25 | docker.destroy: ## Destroy the containers, volumes, networks… 26 | $(call docker-compose,down -v --remove-orphan) 27 | 28 | docker.start: ## Start the containers 29 | $(call docker-compose,start) 30 | 31 | docker.stop: ## Stop the containers 32 | $(call docker-compose,stop) 33 | 34 | docker.restart: ARG= 35 | docker.restart: ## Restart the containers. Use ARG="container-name" if you want to be specific. 36 | $(call docker-compose,restart ${ARGS=""}) 37 | 38 | docker.bash: ## Run bash shell on the "bash" container (user www-data) 39 | $(call docker-compose,exec --user www-data ${BASH_CONTAINER} bash) 40 | 41 | docker.rbash: ## Run bash shell on the "bash" container (user root) 42 | $(call docker-compose,exec --user root ${BASH_CONTAINER} bash) 43 | 44 | docker.node-bash: ## Start node bash 45 | $(call docker-compose,run -u www-data --entrypoint /bin/bash node) 46 | 47 | .PHONY: logs 48 | docker.logs: ## Show containers logs 49 | $(call docker-compose,logs -f) 50 | 51 | docker.dc: ARGS=ps 52 | docker.dc: ## Run docker-compose command. Use ARGS="" to pass parameters to docker-compose. 53 | $(call docker-compose,${ARGS}) 54 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .DEFAULT_GOAL := help 2 | SHELL=/bin/bash 3 | 4 | # Configuration 5 | # ¯¯¯¯¯¯¯¯¯¯¯¯¯ 6 | 7 | SYLIUS_FOLDER=sylius 8 | PHP_VERSION=7.3 9 | DOMAINS=apps/${SYLIUS_FOLDER}:sylius-store 10 | SYLIUS_FIXTURES_SUITE=default 11 | 12 | BASH_CONTAINER=php 13 | export USER_UID=$(shell id -u) 14 | 15 | DC_DIR=infra/dev 16 | DC_PREFIX=sylius 17 | APP_ENV=dev 18 | 19 | ifndef DC_PREFIX 20 | $(error Please define DC_PREFIX before running make) 21 | endif 22 | 23 | 24 | ### QUICK 25 | # ¯¯¯¯¯¯¯ 26 | 27 | up start: docker.up symfony.proxy.start symfony.server.start ## Up 28 | 29 | down: docker.down symfony.proxy.stop symfony.server.stop ## Down 30 | 31 | stop: docker.stop symfony.proxy.stop symfony.server.stop ## Stop 32 | 33 | logs: docker.logs symfony.server.log ## Logs 34 | 35 | 36 | ### PROJECT 37 | # ¯¯¯¯¯¯¯¯¯ 38 | 39 | coffee: ## Launch it, and take coffee ☕️ 40 | ${MAKE} project.infra.update 41 | mkdir -p apps/${SYLIUS_FOLDER} 42 | rm -f .php-version 43 | echo "${PHP_VERSION}" > .php-version 44 | echo "memory_limit=-1" > php.ini 45 | ${MAKE} composer.create-project 46 | mv .php-version apps/${SYLIUS_FOLDER}/ 47 | mv php.ini apps/${SYLIUS_FOLDER}/ 48 | ${MAKE} apply-dist 49 | ${MAKE} SYMFONY_ENV=dev project.install 50 | 51 | project.install: docker.up app.start composer.install sylius.install theme.assets.install theme.install ## Install the project (⚠ Reset database) 52 | project.infra.update: ## Update the Docker infrastructure 53 | ${MAKE} PULL_FROM=1 docker.pull docker.build docker.up 54 | apply-dist: ## Copy dist files 55 | mkdir -p apps/${SYLIUS_FOLDER} 56 | cp -Rv dist/dev/.env* apps/${SYLIUS_FOLDER} 57 | cp -Rv dist/dev/* apps/${SYLIUS_FOLDER} 58 | add-symfony-bin: ## Download Symfony Binary 59 | curl -sS https://get.symfony.com/cli/installer | bash 60 | 61 | include resources/makefiles/application.mk 62 | include resources/makefiles/symfony.mk 63 | include resources/makefiles/sylius.mk 64 | include resources/makefiles/theming.mk 65 | include resources/makefiles/composer.mk 66 | include resources/makefiles/test.mk 67 | include resources/makefiles/docker.mk 68 | include resources/makefiles/help.mk 69 | -------------------------------------------------------------------------------- /resources/makefiles/symfony.mk: -------------------------------------------------------------------------------- 1 | ### SYMFONY 2 | # ¯¯¯¯¯¯¯¯¯ 3 | 4 | define symfony 5 | if [[ "$(2)" != "" ]]; \ 6 | then echo "(cd $(1) && symfony $(2))"; \ 7 | (cd $(1) && symfony $(2)); \ 8 | else \ 9 | echo "(cd apps/${SYLIUS_FOLDER} && symfony $(1))"; \ 10 | (cd apps/${SYLIUS_FOLDER} && symfony $(1)); \ 11 | fi; 12 | endef 13 | 14 | ifeq (${SYMFONY_USE_DOCKER_ONLY},1) 15 | define symfony.console 16 | $(call docker-compose,exec --user www-data ${BASH_CONTAINER} bash -c "cd apps/${SYLIUS_FOLDER}/; ./bin/console $(1)") 17 | endef 18 | else 19 | define symfony.console 20 | cd apps/${SYLIUS_FOLDER} && symfony console $(1) 21 | endef 22 | endif 23 | 24 | ifeq (${SYMFONY_USE_DOCKER_ONLY},1) 25 | define symfony.composer 26 | $(call docker-compose,exec --user www-data ${BASH_CONTAINER} bash -c "cd apps/${SYLIUS_FOLDER}/; composer $(1)") 27 | endef 28 | else 29 | define symfony.composer 30 | cd apps/${SYLIUS_FOLDER} && symfony composer $(1) 31 | endef 32 | endif 33 | 34 | symfony.domain.attach: ## Attach domains to symfony proxy 35 | ifneq (${SYMFONY_USE_DOCKER_ONLY},1) 36 | @for domain in ${DOMAINS}; \ 37 | do \ 38 | folder=`echo $$domain | cut -d: -f 1`; \ 39 | host=`echo $$domain | cut -d: -f 2 | sed 's/,/ /g'`; \ 40 | $(call symfony,$$folder,local:proxy:domain:attach $$host) \ 41 | done; 42 | endif 43 | 44 | symfony.proxy.start: ## Start Symfony proxy 45 | @$(call symfony,local:proxy:start) 46 | 47 | symfony.proxy.stop: ## Stop Symfony proxy 48 | @$(call symfony,local:proxy:stop) 49 | 50 | symfony.server.start: ## Serve the app 51 | ifneq (${SYMFONY_USE_DOCKER_ONLY},1) 52 | ifeq (${SYMFONY_NO_TLS},1) 53 | @$(call symfony,serve --no-tls -d || true) 54 | else 55 | @$(call symfony,serve -d || true) 56 | endif 57 | endif 58 | 59 | symfony.server.stop: ## Serve the app 60 | @$(call symfony,local:server:stop || true) 61 | 62 | symfony.server.restart: symfony.server.stop symfony.server.start ## Restart the app 63 | 64 | symfony.server.log: ## Tail the logs 65 | @$(call symfony,local:server:log) 66 | 67 | symfony.migration.generate: ## Generate migration file 68 | $(call symfony.console, doctrine:migrations:diff) 69 | 70 | symfony.migration.execute: ## Excecute migration file 71 | $(call symfony.console, doctrine:migrations:execute ${ARGS}) 72 | -------------------------------------------------------------------------------- /infra/dev/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | db: 5 | image: monsieurbiz/mariadb:10.2 6 | environment: 7 | MYSQL_ROOT_PASSWORD: root 8 | MYSQL_DATABASE: sylius 9 | volumes: 10 | - database:/var/lib/mysql:rw,cached 11 | ports: 12 | - "3306:3306" 13 | 14 | node: 15 | build: 16 | context: node/ 17 | args: 18 | USER_UID: ${USER_UID} 19 | volumes: 20 | - ../../:/var/www:rw,cached 21 | 22 | mail: 23 | image: monsieurbiz/mailcatcher 24 | ports: 25 | - "1080:1080" 26 | 27 | blackfire: 28 | image: blackfire/blackfire 29 | environment: 30 | - BLACKFIRE_SERVER_ID 31 | - BLACKFIRE_SERVER_TOKEN 32 | 33 | elasticsearch: 34 | build: 35 | context: ./elasticsearch/ 36 | args: 37 | USER_UID: ${USER_UID} 38 | volumes: 39 | - esdata:/usr/share/elasticsearch/data:rw 40 | environment: 41 | - node.name=elasticsearch 42 | - cluster.initial_master_nodes=elasticsearch 43 | - cluster.name=docker-cluster 44 | - bootstrap.memory_lock=true 45 | - "ES_JAVA_OPTS=-Xms512m -Xmx512m" 46 | - "xpack.security.enabled=false" 47 | ulimits: 48 | memlock: 49 | soft: -1 50 | hard: -1 51 | ports: 52 | - "9200:9200" 53 | - "9300:9300" 54 | 55 | cerebro: 56 | image: lmenezes/cerebro 57 | ports: 58 | - "9000:9000" 59 | links: 60 | - elasticsearch 61 | 62 | kibana: 63 | image: kibana:7.4.0 64 | ports: 65 | - "5601:5601" 66 | environment: 67 | - "SERVER_NAME=localhost" 68 | - "ELASTICSEARCH_HOSTS=http://elasticsearch:9200" 69 | - "XPACK_GRAPH_ENABLED=false" 70 | - "XPACK_ML_ENABLED=false" 71 | - "XPACK_REPORTING_ENABLED=false" 72 | - "XPACK_SECURITY_ENABLED=false" 73 | - "XPACK_WATCHER_ENABLED=false" 74 | links: 75 | - elasticsearch 76 | 77 | volumes: 78 | database: {} 79 | esdata: {} 80 | -------------------------------------------------------------------------------- /resources/makefiles/sylius.mk: -------------------------------------------------------------------------------- 1 | ### SYLIUS 2 | # ¯¯¯¯¯¯¯¯ 3 | 4 | sylius.install: sylius.db.refresh sylius.assets.install sylius.theme.assets.install ## Install Sylius 5 | 6 | sylius.db.refresh: sylius.db.schema.reset sylius.fixtures.load ## Refresh Sylius database with fixtures (⚠ Reset database) 7 | 8 | sylius.db.schema.reset: sylius.doctrine.cache.clear sylius.db.schema.reset.current sylius.db.schema.reset.test ## Reset database schema (⚠ Reset database) 9 | 10 | sylius.db.schema.reset.current: ## Reset current database schema (⚠ Reset current database) 11 | $(call symfony.console,doctrine:database:drop --force --if-exists) 12 | $(call symfony.console,sylius:install:database -n) 13 | 14 | sylius.db.schema.reset.test: ## Reset test database schema (⚠ Reset test database) 15 | ifneq (${APP_ENV},fortress) 16 | $(call symfony.console,doctrine:database:drop --force --env=test --if-exists) 17 | $(call symfony.console,sylius:install:database -n --env=test) 18 | endif 19 | 20 | sylius.doctrine.cache.clear: ## Clear Doctrine's cache 21 | $(call symfony.console,doctrine:cache:clear-metadata || true) 22 | $(call symfony.console,doctrine:cache:clear-query || true) 23 | $(call symfony.console,doctrine:cache:clear-result || true) 24 | 25 | sylius.fixtures.load: SUITE=${SYLIUS_FIXTURES_SUITE} 26 | sylius.fixtures.load: ## Load Fixtures (use SUITE="" if you want to change the suite) 27 | $(call symfony.console,sylius:fixtures:load -n ${SUITE}) 28 | 29 | sylius.ckeditor.install: ## Install CKEditor 30 | $(call symfony.console,ckeditor:install -n) 31 | 32 | sylius.assets.install: ## Install sylius assets 33 | $(call symfony.console,assets:install --symlink --relative public) 34 | $(call symfony.console,sylius:install:assets) 35 | 36 | sylius.theme.assets.install: ## Install sylius themes assets 37 | $(call symfony.console,sylius:theme:assets:install --symlink --relative public) 38 | 39 | sylius.warmup: ## Warmup the cache 40 | $(call symfony.console,cache:warmup --no-debug -vvv) 41 | 42 | sylius.cache.clean: FORCE=1 43 | sylius.cache.clean: ## Remove application's cache (use FORCE=0 to use the console) 44 | ifeq (${FORCE},0) 45 | $(call symfony.console,cache:clear --no-warmup) 46 | else 47 | cd apps/${SYLIUS_FOLDER}; rm -rf var/cache/* 48 | endif 49 | 50 | sylius.cache.clean.soft: ## Remove application caches using console 51 | ${MAKE} sylius.cache.clean FORCE=0 52 | 53 | sylius.yarn.upgrade: 54 | $(call docker-compose,run --rm -u www-data -e GULP_MODE=${GULP_MODE} --entrypoint /bin/bash node -c "cd apps/${SYLIUS_FOLDER}; yarn upgrade") 55 | --------------------------------------------------------------------------------