Skip to content

complete project #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions v1/guestbook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@

FROM golang:1.15 as builder
RUN go get github.com/codegangsta/negroni
<Please fill in the required Docker command> go get github.com/gorilla/mux
<Please fill in the required Docker command> go get github.com/xyproto/simpleredis/v2
RUN go get github.com/gorilla/mux
RUN go get github.com/xyproto/simpleredis/v2
COPY main.go .
RUN go build main.go

FROM ubuntu:18.04

<Please fill in the required Docker command> --from=builder /go//main /app/guestbook
<Please fill in the required Docker command> public/index.html /app/public/index.html
<Please fill in the required Docker command> public/script.js /app/public/script.js
<Please fill in the required Docker command> public/style.css /app/public/style.css
<Please fill in the required Docker command> public/jquery.min.js /app/public/jquery.min.js
COPY --from=builder /go//main /app/guestbook
COPY public/index.html /app/public/index.html
COPY public/script.js /app/public/script.js
COPY public/style.css /app/public/style.css
COPY public/jquery.min.js /app/public/jquery.min.js

WORKDIR /app
CMD ["./guestbook"]
<Please fill in the required Docker command> 3000
EXPOSE 3000
6 changes: 3 additions & 3 deletions v1/guestbook/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ spec:
app: guestbook
spec:
containers:
- image: us.icr.io/<your sn labs namespace>/guestbook:v1
- image: us.icr.io/sn-labs-s9tingli/guestbook:v1
imagePullPolicy: Always
name: guestbook
ports:
- containerPort: 3000
name: http
resources:
limits:
cpu: 50m
cpu: 5m
requests:
cpu: 20m
cpu: 2m
replicas: 1
4 changes: 2 additions & 2 deletions v1/guestbook/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<meta charset="utf-8">
<meta content="width=device-width" name="viewport">
<link href="style.css" rel="stylesheet">
<title>Lavanya's Guestbook - v1</title>
<title>Yuting's Guestbook - v1</title>
</head>
<body>
<div id="header">
<h1>Guestbook - v1</h1>
<h1>Guestbook - v2</h1>
</div>

<div id="guestbook-entries">
Expand Down