Skip to content

Commit

Permalink
adjust docker setup script to include environment clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkySharks committed Feb 13, 2019
1 parent a5b4b15 commit 9e6d2f2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
8 changes: 7 additions & 1 deletion docker/run-docker
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
}

Expand Down
4 changes: 3 additions & 1 deletion pwa-devdocs/_drafts/docker-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
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.

0 comments on commit 9e6d2f2

Please sign in to comment.