Skip to content

Commit

Permalink
docker
Browse files Browse the repository at this point in the history
  • Loading branch information
yuuwe-n committed Nov 6, 2022
1 parent e40dc11 commit 3bb32aa
Show file tree
Hide file tree
Showing 9 changed files with 1,615 additions and 2 deletions.
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Parent image = docker apline version
# https://docs.docker.com/develop/develop-images/baseimages/
FROM golang:alpine

#RUN apk add git
#RUN git clone https://github.com/yuuwe-n/RateMyProfessors.help.git

COPY . /app
# subsequent commands are at /rmp directory
# use / to refer to root
WORKDIR /app

RUN go mod download
RUN go mod vendor
RUN go mod verify
# Don't do go build -o /rmp, creates the binary at root
RUN go build

EXPOSE 8080

# CMD needs to be full path or smth
CMD [ "/app/rmp" ]
4 changes: 2 additions & 2 deletions rmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ func main() {
router.POST("/get_rank", getRank)
// router.GET("/get_courses", getCourses) API

err := http.ListenAndServeTLS("127.0.0.1:8080", "/etc/ssl/ratemyprofessors.crt", "/etc/ssl/private/ratemyprofessors.key", router)
err := http.ListenAndServeTLS(":8080", "/etc/ssl/ratemyprofessors.crt", "/etc/ssl/private/ratemyprofessors.key", router)

if err != nil {
fmt.Println(err)
fmt.Println("WARNING: using http instead of https")
log.Fatal(http.ListenAndServe("127.0.0.1:8080", router))
log.Fatal(http.ListenAndServe(":8080", router))
}
}

Expand Down
18 changes: 18 additions & 0 deletions vendor/github.com/julienschmidt/httprouter/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions vendor/github.com/julienschmidt/httprouter/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

300 changes: 300 additions & 0 deletions vendor/github.com/julienschmidt/httprouter/README.md

Large diffs are not rendered by default.

123 changes: 123 additions & 0 deletions vendor/github.com/julienschmidt/httprouter/path.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3bb32aa

Please sign in to comment.