diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml index d42a61c..84a59a2 100644 --- a/.github/workflows/continuous-integration-workflow.yml +++ b/.github/workflows/continuous-integration-workflow.yml @@ -21,6 +21,7 @@ jobs: run: docker-compose up -d env: COMPOSE_PROJECT_NAME: proximis + PROJECT_LOCATION: / - name: "Display images & containers" run: | diff --git a/Makefile b/Makefile index 979a15b..d4f1b69 100644 --- a/Makefile +++ b/Makefile @@ -56,7 +56,6 @@ ps: ## List all containers managed by the environment purge: ## Purge all services and associated volumes docker compose down -v - mutagen sync terminate --label-selector='name==${COMPOSE_PROJECT_NAME}' restart: stop start ## Restart the environment @@ -70,29 +69,11 @@ restore: ## Restore the "mysql" volume 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=".idea" \ - "${PROJECT_LOCATION}" "docker://${COMPOSE_PROJECT_NAME}_synchro/var/www/html/"; \ - else \ - mutagen sync resume --label-selector='name==${COMPOSE_PROJECT_NAME}'; \ - fi - - @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}' .PHONY: backup build cache logs logs mysql nginx php ps purge restart restore start stats stop diff --git a/README.md b/README.md index 79f31cf..ac1605f 100644 --- a/README.md +++ b/README.md @@ -6,35 +6,11 @@ This repository allows the creation of a Docker environment that meets ## Requirements - [Docker](https://www.docker.com/) -- [Mutagen](https://mutagen.io/) ## Installation This process assumes that [Docker Engine](https://www.docker.com/get-started) and [Docker Compose](https://docs.docker.com/compose/) are correctly installed. -Otherwise, you should have a look to the [installation documentation](https://docs.docker.com/install/) before proceeding further. - -### Before installation - -The only dependency required to run the environment is [Mutagen](https://mutagen.io/) which will synchronize your local files with docker's containers for maximize performances. -See the [installation documentation](https://mutagen.io/documentation/introduction/installation/) to install it on your system. - -On Mac OS, simply run these following commands: - -```bash -brew install mutagen-io/mutagen/mutagen -``` - -If you want that mutagen automatically starts with your system: - -```bash -mutagen daemon register -``` - -You can also start it manually: - -```bash -mutagen daemon start -``` +Otherwise, you should have a look to the [installation documentation](https://docs.docker.com/install/) before proceeding further. ### Add the package to development requirements diff --git a/docker-compose.yml b/docker-compose.yml index 00255a8..7fa145e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -54,7 +54,7 @@ services: - "443:443" volumes: # Projects files - - code_sync:/var/www/html:nocopy + - ${PROJECT_LOCATION}:/var/www/html:rw,delegated # Websites configuration - ${PROJECT_LOCATION}/docker/local/nginx.conf:/etc/nginx/conf.d/custom.conf:ro # Logs @@ -72,7 +72,7 @@ services: - SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock volumes: # Projects 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 @@ -95,15 +95,7 @@ services: - redis:/data tty: true - synchro: - build: - context: ./synchro - container_name: ${COMPOSE_PROJECT_NAME}_synchro - volumes: - - code_sync:/var/www/html:nocopy - volumes: - code_sync: {} elasticsearch: {} mysql: {} redis: {} diff --git a/synchro/Dockerfile b/synchro/Dockerfile deleted file mode 100644 index a6fc52c..0000000 --- a/synchro/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM alpine:latest - -# Create a new user/group with the same ID than in "nginx" and "php" services -RUN \ - addgroup -g 1000 -S synchro && \ - adduser -u 1000 -D -S -G synchro synchro - -CMD ["tail", "-f", "/dev/null"]