Skip to content

Instantly share code, notes, and snippets.

@yanmhlv
Last active February 9, 2016 08:27
Show Gist options
  • Save yanmhlv/6e48559c3fae6ba813e9 to your computer and use it in GitHub Desktop.
Save yanmhlv/6e48559c3fae6ba813e9 to your computer and use it in GitHub Desktop.
FROM golang:1.5.3
EXPOSE 3000
RUN mkdir -p /go/src/myapp
COPY . /go/src/myapp
RUN cd /go/src/myapp \
&& go get -d \
&& go install myapp
ENTRYPOINT /go/bin/myapp
package main
import "github.com/labstack/echo"
func GetApplication() *echo.Echo {
e := echo.New()
e.Get("/", func(c *echo.Context) error {
return c.String(200, "done")
})
return e
}
func main() {
GetApplication().Run(":3000")
}
@yanmhlv
Copy link
Author

yanmhlv commented Feb 8, 2016

docker build -t myapp .
docker run --rm --name myapp -p 3000:3000 myapp
docker stop myapp
docker ps -a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment