Skip to content

Commit

Permalink
style(polish): format code
Browse files Browse the repository at this point in the history
  • Loading branch information
xmlking committed Nov 20, 2018
1 parent c9b7e3c commit aee0634
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 307 deletions.
39 changes: 26 additions & 13 deletions .deploy/webapp/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
WebApp
======
# WebApp

Dockerize Angular WebApp

> use [nginxconfig](https://nginxconfig.io/) to generate `nginx.conf`
### Deploy

#### Build Nginx

> Build and publish custom nginx image for OpenShift (One time only)
```bash
docker build -t openshift-nginx -f .deploy/webapp/nginx.dockerfile .
docker tag openshift-nginx xmlking/openshift-nginx:1.14-alpine
Expand All @@ -18,19 +21,23 @@ docker push xmlking/openshift-nginx:latest
```

#### Build App

> Build ngx-starter-kit docker image
```bash
# build app docker image
docker build --tag=ngx-starter-kit -f .deploy/webapp/prod.dockerfile .
docker build --tag=ngx-starter-kit -f .deploy/webapp/prod.dockerfile .
```

#### Docker Push

> Push ngx-starter-kit docker image
```bash
# login to hub.docker.com to push docker image
docker login

# tag
# tag
docker tag ngx-starter-kit xmlking/ngx-starter-kit:1.0.0-SNAPSHOT
docker tag xmlking/ngx-starter-kit:1.0.0-SNAPSHOT xmlking/ngx-starter-kit:latest

Expand All @@ -40,7 +47,9 @@ docker push xmlking/ngx-starter-kit:latest
```

#### OpenShift Deployment

> Deploy ngx-starter-kit app to OpenShift
```bash
# login with your ID
oc login <my OpenShift URL>
Expand All @@ -59,29 +68,32 @@ oc delete all -l app=webapp -n cockpit
oc delete all,configmap,secret -l app=webapp -n ngx-starter-kit

# redeploy
from OpenShift Console UI,
Applications > Deployments > webapp > Deploy
from OpenShift Console UI,
Applications > Deployments > webapp > Deploy
```


### K8S Commands

```bash
kubectl get services
kubectl get pods
kubectl logs -f keycloak-server-6-grfmg
```

### Run
### Run

Run docker locally for testing.

```bash
docker run -it -p 4200:8080 -v .deploy/webapp/nginx.conf:/etc/nginx/conf.d/nginx.conf cockpit
```

The app will be available at http://localhost:4200

You can tweak the nginx config ```nginx.conf``` for your specific needs.
You can tweak the nginx config `nginx.conf` for your specific needs.

### SSH

```bash
# SSH to the running container (CONTAINER ID from `docker ps` command)
docker exec -it <CONTAINER ID> sh
Expand All @@ -90,13 +102,14 @@ docker-compose exec web sh
```

###Maintenance

```bash
docker container prune
docker image prune
```


### Ref
* If you get 137 error
* https://samwize.com/2016/05/19/docker-error-returned-a-non-zero-code-137/
* https://docs.docker.com/docker-for-mac/#advanced

- If you get 137 error
- https://samwize.com/2016/05/19/docker-error-returned-a-non-zero-code-137/
- https://docs.docker.com/docker-for-mac/#advanced
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
# dependencies
/node_modules

# profiling files
chrome-profiler-events.json
speed-measure-plugin.json

# IDEs and editors
/.idea
.project
Expand Down
11 changes: 6 additions & 5 deletions PLAYBOOK.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ Do-it-yourself step-by-step instructions to create this project structure from s
|-------------------------------|----------|----------|
| Node | v11.1.0 | |
| NPM | v6.4.1 | |
| Angular CLI | v7.0.0 | |
| @nrwl/schematics | v7.0.0 | |
| @nestjs/cli | v5.6.2 | |
| Angular CLI | v7.1.0 | |
| @nrwl/schematics | v7.1.0 | |
| @nestjs/cli | v5.6.3 | |
| semantic-release-cli | v4.0.11 | |

### Install Prerequisites
```bash
Expand Down Expand Up @@ -55,7 +56,7 @@ npm remove -g @nestjs/cli
npm remove -g semantic-release-cli
npm remove -g commitizen

npm install -g @angular/cli
npm install -g @angular/cli@next
npm install -g @nrwl/schematics
npm install -g @nestjs/cli
npm install -g semantic-release-cli
Expand Down Expand Up @@ -108,7 +109,7 @@ ng update --all
# generate webapp app
ng g app webapp --routing --style=scss --prefix=ngx --unit-test-runner=jest --e2e-test-runner=cypress --tags=app-module --dry-run
# or with ivy renderer
ng g app webapp --routing --style=scss --prefix=ngx --unit-test-runner=jest --e2e-test-runner=cypress --tags=app-module --experimental-ivy --dry-run
ng g app webapp --routing --style=scss --prefix=ngx --unit-test-runner=jest --e2e-test-runner=cypress --tags=app-module --dry-run -- --experimental-ivy

# generate api app with nestjs
ng g node-app api --framework=express --unit-test-runner=jest --tags=api-module --dry-run
Expand Down

0 comments on commit aee0634

Please sign in to comment.