cmd/tipgodoc: simplify Dockerfile and fix deployment
Change-Id: Ib2fd1346255467cb790a9e4c37d25f8e8ca136f5 Reviewed-on: https://go-review.googlesource.com/2534 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
dc0000626d
commit
0e66a62615
|
@ -1,14 +1,9 @@
|
|||
FROM google/appengine-go
|
||||
FROM golang
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install --no-install-recommends -y -q curl build-essential git
|
||||
RUN mkdir /goroot && curl https://storage.googleapis.com/golang/go1.4.linux-amd64.tar.gz | tar xvzf - -C /goroot --strip-components=1
|
||||
RUN mkdir /gopath
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y -q build-essential git
|
||||
|
||||
ENV GOROOT /goroot
|
||||
ENV GOPATH /gopath
|
||||
ENV PATH $PATH:$GOROOT/bin:$GOPATH/bin
|
||||
|
||||
WORKDIR /app
|
||||
ADD . /app
|
||||
RUN /bin/bash /app/_ah/build.sh
|
||||
# golang sets GOPATH=/go
|
||||
ADD . /go/src/tipgodoc
|
||||
RUN go install tipgodoc
|
||||
ENTRYPOINT ["/go/bin/tipgodoc"]
|
||||
EXPOSE 8080 # what kubernetes expects
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
To deploy as an App Engine Manged VM, use gcloud:
|
||||
|
||||
$ gcloud preview app deploy .
|
|
@ -13,4 +13,3 @@ handlers:
|
|||
|
||||
health_check:
|
||||
enable_health_check: False
|
||||
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// Use of this source code is governed by the Apache 2.0
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build appenginevm
|
||||
|
||||
// Command tipgodoc is the beginning of the new tip.golang.org server,
|
||||
// serving the latest HEAD straight from the Git oven.
|
||||
package main
|
||||
|
@ -30,10 +28,11 @@ const (
|
|||
metaURL = "https://go.googlesource.com/?b=master&format=JSON"
|
||||
)
|
||||
|
||||
func init() {
|
||||
func main() {
|
||||
p := new(Proxy)
|
||||
go p.run()
|
||||
http.Handle("/", p)
|
||||
log.Fatal(http.ListenAndServe(":8080", nil))
|
||||
}
|
||||
|
||||
type Proxy struct {
|
||||
|
|
Loading…
Reference in New Issue