This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:latest | |
LABEL maintainer="your name <YOURNAME@example.com>" | |
WORKDIR /app | |
COPY go.mod ./ | |
RUN go mod download | |
COPY . . | |
RUN go build -o demo | |
EXPOSE 80 | |
CMD ["./demo"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"net/http" | |
"os" | |
"log" | |
"github.com/gorilla/mux" | |
) | |
func determineListenAddress() (string, error) { | |
port := os.Getenv("PORT") |