Skip to content

Commit

Permalink
Dockerize app (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
FelicianoTech authored Oct 23, 2023
1 parent 53ac65e commit 23d2667
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM golang:1.21.3

LABEL org.opencontainers.image.source https://github.com/cloud-unpacked/ippi

WORKDIR /app

COPY go.mod go.sum ./

RUN go mod download

COPY ippi /app/ippi

WORKDIR /app/ippi

RUN CGO_ENABLED=0 GOOS=linux go build -o /the-go-app

CMD ["/the-go-app"]

EXPOSE 9000
4 changes: 4 additions & 0 deletions goreleaser.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM scratch
ENTRYPOINT ["/ippi"]
COPY ippi /
EXPOSE 9000
2 changes: 1 addition & 1 deletion ippi/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func main() {
// Start the server.
port := os.Getenv("PORT")
if port == "" {
port = "3000"
port = "9000"
}

log.Println("Starting HTTP server on port:", port)
Expand Down

0 comments on commit 23d2667

Please sign in to comment.