Skip to content

Commit

Permalink
Issue #55: Update README with docker instructions
Browse files Browse the repository at this point in the history
Added instruction on how to run and deploy application using Docker.
  • Loading branch information
CarlosRodrigo authored and rodrigoperazzo committed Mar 7, 2019
1 parent 68ad40f commit ff983af
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ workflows:
branches:
only:
- dev
- master
- master
36 changes: 34 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
```
2 changes: 1 addition & 1 deletion scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ff983af

Please sign in to comment.