diff --git a/docker-compose.yml b/docker-compose.yml index 6e0353a898..a028115c46 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,11 @@ # Docker Compose file for FreeCodeCamp # -# If using Docker Toolbox, replace `localhost` to output form `docker-machine ip` +# If using Docker Toolbox, set `DOCKER_HOST_LOCATION` env var to output from +# `docker-machine ip` # # If you have previously run freeCodeCamp outside of docker, run # npm run clean # and select 'yes' to remove all node_module folders -# # before trying to bootstrap the project # # Bootstrap with: @@ -37,9 +37,9 @@ services: user: node environment: - API_PROXY=http://api-server:3000 - - GATSBY_WEBPACK_PUBLICPATH=http://localhost:8000/ - - HOME_LOCATION=http://localhost:8000 - - API_LOCATION=http://localhost:3000 + - GATSBY_WEBPACK_PUBLICPATH=http://$DOCKER_HOST_LOCATION:8000/ + - HOME_LOCATION=http://$DOCKER_HOST_LOCATION:8000 + - API_LOCATION=http://$DOCKER_HOST_LOCATION:3000 volumes: - .:/app working_dir: /app/client @@ -56,9 +56,9 @@ services: environment: - MAILHOG_HOST=mailhog - MONGOHQ_URL=mongodb://db:27017/freecodecamp - - COOKIE_DOMAIN=localhost - - HOME_LOCATION=http://localhost:8000 - - API_LOCATION=http://localhost:3000 + - COOKIE_DOMAIN=$DOCKER_HOST_LOCATION + - HOME_LOCATION=http://$DOCKER_HOST_LOCATION:8000 + - API_LOCATION=http://$DOCKER_HOST_LOCATION:3000 volumes: - .:/app working_dir: /app/api-server diff --git a/sample.env b/sample.env index 54a9f2a6a2..92b2b34262 100644 --- a/sample.env +++ b/sample.env @@ -30,3 +30,4 @@ NEWS_LOCATION='https://news.localhost/latest' LOCALE=english TEST_CHALLENGES_FOR_LANGS=english +DOCKER_HOST_LOCATION=localhost