From 1d420a2507630d462cd8b8125b9226b805e36a74 Mon Sep 17 00:00:00 2001 From: hawkup Date: Sat, 9 Feb 2019 18:57:11 +0700 Subject: [PATCH] Separate variable flag container path out from APP_CODE_PATH_CONTAINER (#1591) Because Container cannot volume when use APP_CODE_PATH_CONTAINER (with flag) concat with path name, e.g. /var/www:nocache/letencrypt This will fix 1540. --- DOCUMENTATION/content/documentation/index.md | 2 +- docker-compose.yml | 16 ++++++++-------- env-example | 7 +++++-- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/DOCUMENTATION/content/documentation/index.md b/DOCUMENTATION/content/documentation/index.md index 0e11cf7..7795184 100644 --- a/DOCUMENTATION/content/documentation/index.md +++ b/DOCUMENTATION/content/documentation/index.md @@ -1832,7 +1832,7 @@ Laradock comes with `sync.sh`, an optional bash script, that automates installin DOCKER_SYNC_STRATEGY=native_osx ``` -3) set `APP_CODE_PATH_CONTAINER=/var/www` to `APP_CODE_PATH_CONTAINER=/var/www:nocopy` in the .env file +3) set `APP_CODE_CONTAINER_FLAG` to `APP_CODE_CONTAINER_FLAG=:nocopy` in the .env file 4) Install the docker-sync gem on the host-machine: ```bash diff --git a/docker-compose.yml b/docker-compose.yml index bac93ac..7c6bf3a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -107,7 +107,7 @@ services: - BLACKFIRE_CLIENT_ID=${BLACKFIRE_CLIENT_ID} - BLACKFIRE_CLIENT_TOKEN=${BLACKFIRE_CLIENT_TOKEN} volumes: - - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER} + - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG} extra_hosts: - "dockerhost:${DOCKER_HOST_IP}" ports: @@ -164,7 +164,7 @@ services: - INSTALL_YAML=${PHP_FPM_INSTALL_YAML} volumes: - ./php-fpm/php${PHP_VERSION}.ini:/usr/local/etc/php/php.ini - - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER} + - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG} expose: - "9000" extra_hosts: @@ -197,7 +197,7 @@ services: - PUID=${PHP_WORKER_PUID} - PGID=${PHP_WORKER_PGID} volumes: - - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER} + - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG} - ./php-worker/supervisord.d:/etc/supervisord.d depends_on: - workspace @@ -233,7 +233,7 @@ services: - PHP_UPSTREAM_PORT=${NGINX_PHP_UPSTREAM_PORT} - CHANGE_SOURCE=${CHANGE_SOURCE} volumes: - - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER} + - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG} - ${NGINX_HOST_LOG_PATH}:/var/log/nginx - ${NGINX_SITES_PATH}:/etc/nginx/sites-available - ${NGINX_SSL_PATH}:/etc/nginx/ssl @@ -267,7 +267,7 @@ services: - PHP_UPSTREAM_TIMEOUT=${APACHE_PHP_UPSTREAM_TIMEOUT} - DOCUMENT_ROOT=${APACHE_DOCUMENT_ROOT} volumes: - - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER} + - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG} - ${APACHE_HOST_LOG_PATH}:/var/log/apache2 - ${APACHE_SITES_PATH}:/etc/apache2/sites-available ports: @@ -283,7 +283,7 @@ services: hhvm: build: ./hhvm volumes: - - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER} + - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG} expose: - "9000" depends_on: @@ -536,7 +536,7 @@ services: caddy: build: ./caddy volumes: - - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER} + - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG} - ${CADDY_CONFIG_PATH}:/etc/caddy - ${CADDY_HOST_LOG_PATH}:/var/log/caddy - ${DATA_PATH_HOST}:/root/.caddy @@ -909,7 +909,7 @@ services: build: context: ./aws volumes: - - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER} + - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG} depends_on: - workspace tty: true diff --git a/env-example b/env-example index d9a9216..e3cdca0 100644 --- a/env-example +++ b/env-example @@ -7,8 +7,11 @@ # Point to the path of your applications code on your host APP_CODE_PATH_HOST=../ -# Point to where the `APP_CODE_PATH_HOST` should be in the container. You may add flags to the path `:cached`, `:delegated`. When using Docker Sync add `:nocopy` -APP_CODE_PATH_CONTAINER=/var/www:cached +# Point to where the `APP_CODE_PATH_HOST` should be in the container +APP_CODE_PATH_CONTAINER=/var/www + +# You may add flags to the path `:cached`, `:delegated`. When using Docker Sync add `:nocopy` +APP_CODE_CONTAINER_FLAG=:cached # Choose storage path on your machine. For all storage systems DATA_PATH_HOST=~/.laradock/data