From ff983afc68fbd981dffa84e54b882296c600ef7f Mon Sep 17 00:00:00 2001 From: Carlos Rodrigo Garcia Date: Mon, 25 Feb 2019 18:33:38 -0300 Subject: [PATCH] Issue #55: Update README with docker instructions Added instruction on how to run and deploy application using Docker. --- .circleci/config.yml | 2 +- README.md | 36 ++++++++++++++++++++++++++++++++++-- scripts/deploy.sh | 2 +- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 23890ac..9f41694 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -66,4 +66,4 @@ workflows: branches: only: - dev - - master \ No newline at end of file + - master diff --git a/README.md b/README.md index 42c0d29..9c40882 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ -# sticky-sessions-web +# Sticky Sessions Web -> StickySessions web project +[![CircleCI](https://circleci.com/gh/DiscordTime/sticky-sessions-web.svg?style=svg)](https://circleci.com/gh/DiscordTime/sticky-sessions-web) + +> Sticky Sessions is an application that helps medium to large teams to share and store their thoughts through digital-like retrospective sessions. This is the repository of the Web client. ## Build Setup @@ -19,3 +21,33 @@ npm run build --report ``` For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). + +## Docker Setup + +There is also the option to develop and build the application using Docker. + +The application's [Dockerfile](Dockerfile) is a multi-stage Dockerfile. It has a base development image that can be used in a dev environemt, this base image contains all projects's dependencies. The production image only has the application and necessary libs to serve the app in a production environment. + +It is possible to build the production image with the following command: + +``` +docker build -t sticky-web-client-prod . +``` + +In order to run the application you can eith run: + +``` +docker run -it -p 80:80 --rm sticky-web-client-prod +``` + +If you wish to build the development image you only need to add the target flag with the image name: + +``` +docker build --target dev -t sticky-web-client-dev . +``` + +And to use ir for development you can bind a volume to the project folder and add the HOST variable to enable Hot Reload: + +``` +docker run -it -p 8080:8080 -v $(pwd)/src:/app/src -e HOST=0.0.0.0 --rm sticky-web-client-dev +``` \ No newline at end of file diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 1303e6e..5f9afb3 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -13,7 +13,7 @@ fi # Authenticate to Google Container Registry gcloud auth print-access-token | docker login -u oauth2accesstoken --password-stdin https://gcr.io -if [ "$CIRCLE_BRANCH" = "issue_55_cd" ]; then +if [ "$CIRCLE_BRANCH" = "dev" ]; then echo "Deploying application to Staging environment" # Injects firebase DB file