Skip to content

Instantly share code, notes, and snippets.

View shashank404error's full-sized avatar
🎯
Focusing

shashank prakash shashank404error

🎯
Focusing
View GitHub Profile
@shashank404error
shashank404error / Dockerfile
Last active October 27, 2020 08:48
Dockerfile for go server app
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"]
@shashank404error
shashank404error / main.go
Last active October 27, 2020 07:35
A simple go server with a single route.
package main
import (
"net/http"
"os"
"log"
"github.com/gorilla/mux"
)
func determineListenAddress() (string, error) {
port := os.Getenv("PORT")