diff --git a/docker/README.md b/docker/README.md index 038bb79968a..2ce5e4a3dc7 100644 --- a/docker/README.md +++ b/docker/README.md @@ -2,7 +2,9 @@ This directory stores certificates for local SSL/TLS, created by running `run-docker` script, as well as configuration for docker environment setup. -Run the `docker/run-docker` script from the root of the repository to create a container running PWA with a secure https protocol. +Run the `docker/run-docker` script from the root of the repository to create a container running PWA with a secure https protocol. + +*NOTE: Running this script in the shell sets a number of environment variables for docker-compose to consume. You may want to run this in a separate shell if you desire to retain your shell environment for other purposes.* This script will: diff --git a/docker/run-docker b/docker/run-docker index 19dc3dd009d..f698bba530d 100755 --- a/docker/run-docker +++ b/docker/run-docker @@ -12,6 +12,7 @@ HOSTPRESENT=false main () { # copy environment variables to .env in root for docker-compose to consume for build + message "Adding environment variables in root .env for docker setup.\nOPEN A NEW SHELL WINDOW FOR A CLEAN ENVIRONMENT" cp ./docker/.env.docker $ENVFILE . $ENVFILE @@ -118,8 +119,13 @@ start_docker () { message "Building PWA image" docker-compose build + # clean up: delete .env that was added for the docker-compose build + # this ensures that when users open a new shell the .env values won't carry over to the new shell + if [ -f .env ]; then + rm .env + fi + message "Starting Docker network and containers" - message "You may see some warnings that @magento/venia-drivers could not be \n resolved. This is normal and not an error." docker-compose up } diff --git a/pwa-devdocs/_drafts/docker-setup.md b/pwa-devdocs/_drafts/docker-setup.md index 7db2812484a..ff568ebc417 100644 --- a/pwa-devdocs/_drafts/docker-setup.md +++ b/pwa-devdocs/_drafts/docker-setup.md @@ -14,4 +14,6 @@ The domain is configurable. Two changes are needed to configure a new domain name. 1. Change `PWA_STUDIO_PUBLIC_PATH` key to the new domain under `docker/.env.docker`. -2. Change the `--host` value in the `watch:docker` script under `packages/venia-concept/package.json` to the new domain. \ No newline at end of file +2. Change the `--host` value in the `watch:docker` script under `packages/venia-concept/package.json` to the new domain. + +*NOTE:* Open a new shell window for a clean work environment if you decide to work outside of the Docker environment.