Skip to content

Commit

Permalink
Remove mutagen usage (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
duboiss authored Aug 10, 2023
1 parent 8090c65 commit 1d55961
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 42 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ jobs:

- name: "Prepare building context"
run: |
# the time that #90 be merged
sed -i '/PHP_IDE_CONFIG/d' .env.dist
sed -i '/${PROJECT_LOCATION}/d' docker-compose.yml
sed -i '/PROJECT_LOCATION/d' docker-compose.yml
# Remove nginx block because of its "volumes" empty array
sed -i '/^\s*nginx:/,/^ *$/d' docker-compose.yml
- name: "Build containers"
run: |
Expand Down
27 changes: 1 addition & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ php: ## Open a terminal in the "php" container
ps: ## List all containers managed by the environment
docker compose ps

purge: ## Purge all services, associated volumes and the Mutagen session
purge: ## Purge all services, associated volumes
docker compose down --volumes
mutagen sync terminate --label-selector='name==${COMPOSE_PROJECT_NAME}'

redis: ## Open a terminal in the "redis" container
docker compose exec redis sh
Expand Down Expand Up @@ -85,35 +84,11 @@ root: ## Display the commands to set up the environment for an advanced usage
start: ## Start the environment
@docker compose up --detach --remove-orphans

@if [[ ! "$$(mutagen sync list --label-selector='name==${COMPOSE_PROJECT_NAME}')" =~ "${COMPOSE_PROJECT_NAME}" ]]; then \
mutagen sync create \
--label=name="${COMPOSE_PROJECT_NAME}" \
--default-owner-beta="id:1000" \
--default-group-beta="id:1000" \
--mode="two-way-resolved" \
--ignore-vcs --ignore="pub/static" \
--ignore="var/page_cache/**" --ignore="var/composer_home/**" \
--ignore="var/view_preprocessed/**" --ignore="generated/**" \
--symlink-mode="posix-raw" \
"${PROJECT_LOCATION}" "docker://${COMPOSE_PROJECT_NAME}_synchro/var/www/html/"; \
else \
mutagen sync resume --label-selector='name==${COMPOSE_PROJECT_NAME}'; \
fi

@echo "Fixing permissions on the shared SSH agent..."
@docker compose exec -T php bash -c "chown www-data:www-data /run/host-services/ssh-auth.sock"

@while [[ ! "$$(mutagen sync list --label-selector='name==${COMPOSE_PROJECT_NAME}')" =~ "Status: Watching for changes" ]]; do \
echo "Waiting for synchronization to complete..."; \
sleep 10; \
done

stats: ## Print real-time statistics about containers ressources usage
docker stats $(docker ps --format={{.Names}})

stop: ## Stop the environment
@docker compose stop
@mutagen sync pause --label-selector='name==${COMPOSE_PROJECT_NAME}'

yarn: ## Install Composer dependencies from the "php" container
$(PHP_SERVICE) "yarn install --cwd=/var/www/html"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ This repository allows the creation of a Docker environment that meets
* `nginx`: [ajardin/magento2-nginx](https://hub.docker.com/r/ajardin/magento2-nginx) custom image with HTTPS (web server).
* `php` : [ajardin/php](https://hub.docker.com/r/ajardin/php) custom image with additional extensions and Composer.
* `redis`: [redis](https://store.docker.com/images/redis) image (Magento session and caches).
* `synchro`: [ajardin/synchro](https://hub.docker.com/r/ajardin/synchro) image (Synchronization using [Mutagen](https://mutagen.io/)).

## Documentation
> In order to make things more readable, and maintainable, the documentation has been migrated to
the [repository Wiki](https://github.com/EmakinaFR/docker-magento2/wiki). Where you will find all details about the
installation process along the available instructions for the day-to-day work.

13 changes: 2 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.4"

services:
blackfire:
image: blackfire/blackfire:2
Expand Down Expand Up @@ -42,7 +40,7 @@ services:
- 443:443
volumes:
# Project files
- code_sync:/var/www/html:nocopy
- ${PROJECT_LOCATION}:/var/www/html:rw,delegated
# Custom configuration
- ${PROJECT_LOCATION}/docker/local/nginx.conf:/etc/nginx/conf.d/custom.conf:ro
tty: true
Expand All @@ -54,7 +52,7 @@ services:
- SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock
volumes:
# Project files
- code_sync:/var/www/html:nocopy
- ${PROJECT_LOCATION}:/var/www/html:rw,delegated
# Custom configuration
- ./php/conf.d/custom.ini:/usr/local/etc/php/conf.d/custom.ini:ro
# SSH socket
Expand All @@ -70,14 +68,7 @@ services:
- redis:/data
tty: true

synchro:
image: ajardin/synchro:latest
container_name: ${COMPOSE_PROJECT_NAME}_synchro
volumes:
- code_sync:/var/www/html:nocopy

volumes:
code_sync: {}
elasticsearch: {}
mysql: {}
redis: {}

0 comments on commit 1d55961

Please sign in to comment.