Skip to content

Commit 7aaacf1

Browse files
committed
verified on intel macbook
1 parent a335bb5 commit 7aaacf1

File tree

4 files changed

+23
-11
lines changed

4 files changed

+23
-11
lines changed

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Usage:
22
#
33
# Build image:
4-
# docker build -t jojozhuang/text-compare-angular-arm . -f Dockerfile-ARM
4+
# docker build -t jojozhuang/text-compare-angular .
55
#
66
# Run image (on localhost:12010):
7-
# docker run -d --name text-compare -p 12010:80 jojozhuang/text-compare-angular-arm
7+
# docker run -d --name text-compare -p 12010:80 jojozhuang/text-compare-angular
88
#
99
# Run image as virtual host (read more: https://github.com/nginx-proxy/nginx-proxy):
1010
# docker run -e VIRTUAL_HOST=text-compare.your-domain.com --name text-compare jojozhuang/text-compare-angular
@@ -22,7 +22,7 @@ RUN npm ci --quiet && npm run build-nas
2222

2323
# Stage 2, based on Nginx, to have only the compiled app, ready for production with Nginx
2424

25-
FROM arm64v8/nginx
25+
FROM nginx:1.19.8-alpine
2626

2727
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
2828

Dockerfile-old renamed to Dockerfile-arm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Usage:
22
#
33
# Build image:
4-
# docker build -t jojozhuang/text-compare-angular .
4+
# docker build -t jojozhuang/text-compare-angular-arm . -f Dockerfile-ARM
55
#
66
# Run image (on localhost:12010):
7-
# docker run -d --name text-compare -p 12010:80 jojozhuang/text-compare-angular
7+
# docker run -d --name text-compare -p 12010:80 jojozhuang/text-compare-angular-arm
88
#
99
# Run image as virtual host (read more: https://github.com/nginx-proxy/nginx-proxy):
1010
# docker run -e VIRTUAL_HOST=text-compare.your-domain.com --name text-compare jojozhuang/text-compare-angular
@@ -22,7 +22,7 @@ RUN npm ci --quiet && npm run build-nas
2222

2323
# Stage 2, based on Nginx, to have only the compiled app, ready for production with Nginx
2424

25-
FROM nginx:1.19.8-alpine
25+
FROM arm64v8/nginx
2626

2727
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
2828

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ docker run --name text-compare-angular -p 8080:80 text-compare-angular
4040
```
4141
Access http://localhost:8080/ in web browser and click 'Text Compare' menu, enjoy!
4242

43+
# Setup in K8s
44+
45+
```sh
46+
# 1. Build image
47+
docker build -t text-compare-angular .
48+
# 2. Deploy to k8s:
49+
kubectl apply -f k8s/text-compare.yaml
50+
# 3. Create service in minikube:
51+
minikube service text-compare-service
52+
# 4. Web browser will be opened automatically to access the site.
53+
```
54+
4355
# Deployment
4456
Read tutorial [Deploying Text Compare Angular App to Docker](https://jojozhuang.github.io/tutorial/deploying-text-compare-angular-app-to-docker) to learn how this angular app is deployed to Docker.
4557

k8s/text-compare.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Setup loocally
2-
# 1. Build image for ARM platform
3-
# docker build -t text-compare-angular-arm . -f Dockerfile-ARM
4-
# 2. Deploy to k8s:
2+
# 1. Build image
3+
# docker build -t text-compare-angular .
4+
# 2. Deploy to k8s:
55
# kubectl apply -f k8s/text-compare.yaml
6-
# 3. Create service in minikube:
6+
# 3. Create service in minikube:
77
# minikube service text-compare-service
8-
# 4. Access the url from step 3.
8+
# 4. Web browser will be opened automatically to access the site.
99

1010
apiVersion: apps/v1
1111
kind: Deployment

0 commit comments

Comments
 (0)