diff --git a/dev/README.md b/dev/README.md index e1f22c190..cbff70a35 100644 --- a/dev/README.md +++ b/dev/README.md @@ -1,5 +1,8 @@ # Use Docker Compose to develop lineblocs +## Notice +Please make sure use docker compose with minimal version 2.2 + ## Structure of directory ```shell . @@ -27,6 +30,7 @@ $ cd dev $ cp .env.example .env $ docker compose build --no-cache $ docker compose --profile enable_mysql --profile enable_proxy up -d +$ docker compose --profile enable_mysql --profile enable_proxy watch ``` Open web browser `http://127.0.0.1:22023` -> `site lineblocs` @@ -57,7 +61,7 @@ $ cd .. $ cd dev ``` -### Make .env file and confige +### Make .env file and config ```shell $ cp .env.example .env ``` @@ -91,7 +95,9 @@ Create and run container with this command below. ```shell $ docker compose --profile enable_mysql --profile enable_proxy up -d ``` - +```shell +$ docker compose --profile enable_mysql --profile enable_proxy watch +``` ### Access lineblocs Lineblocs-site -> http://127.0.0.1:{MYSQL_PORT_HOST} or http://{DEPLOYMENT_DOMAIN} `--enable_proxy` must use Lineblocs-phpmyadmin -> -> http://127.0.0.1:{PHPMYADMIN_PORT_HOST} or http://{DEPLOYMENT_DOMAIN} `--enable_proxy` must use diff --git a/dev/docker-compose.yaml b/dev/docker-compose.yaml index c21e33376..a23ce42f1 100644 --- a/dev/docker-compose.yaml +++ b/dev/docker-compose.yaml @@ -46,7 +46,7 @@ services: volumes: - /var/run/docker.sock:/tmp/docker.sock:ro site: - # use image from docker hub. Need side project live but not develop site project + # use this image below from docker hub. Need site project live but not develop site project #image: lineblocs/site:master # end of use image from docker hub # use dockerfile as image. Development site project, use this config @@ -54,9 +54,33 @@ services: context: ../app dockerfile: Dockerfile image: lineblocs-site - volumes: - - ../app:/var/www/html # end of use docekrfile as image + # Please choose, use block of "volumes" or "develop" + # volumes: + # - ../app:/var/www/html + develop: + watch: + - action: sync + path: ../app + target: /var/www/html + ignore: + - node_modules/ + - vendor/ + - action: sync+restart + path: ../app/shell_scripts/entrypoint.sh + target: /var/www/html/shell_scripts/entrypoint.sh + - action: sync+restart + path: ../app/composer.json + target: /var/www/html/composer.json + - action: sync+restart + path: ../app/package.json + target: /var/www/html/package.json + - action: rebuild + path: ../app/Dockerfile + - action: rebuild + path: ./docker-compose.yaml + - action: rebuild + path: ./.env logging: *default-logging container_name: lineblocs-site restart: unless-stopped