tree: fdfe94b6e4cca746c660fbbb1c9a504b39143ecc [path history] [tgz]
  1. static/
  2. app.yaml
  3. AUTHORS
  4. cache.go
  5. client.go
  6. codereview.cfg
  7. CONTRIBUTING.md
  8. CONTRIBUTORS
  9. Dockerfile
  10. edit.go
  11. edit.html
  12. enable-fake-time.patch
  13. fake_fs.lst
  14. fmt.go
  15. go.mod
  16. go.sum
  17. LICENSE
  18. logger.go
  19. main.go
  20. Makefile
  21. PATENTS
  22. play.go
  23. play_test.go
  24. README.md
  25. sandbox.go
  26. server.go
  27. server_test.go
  28. share.go
  29. store.go
  30. tests.go
  31. vet.go
README.md

playground

This subrepository holds the source for the Go playground: https://play.golang.org/

Building

# build the image
docker build -t playground .

Running

docker run --name=play --rm -d -p 8080:8080 playground
# run some Go code
cat /path/to/code.go | go run client.go | curl -s --upload-file - localhost:8080/compile

Deployment

Building the playground Docker container takes more than the default 10 minute time limit of cloud build, so increase its timeout first (note, app/cloud_build_timeout is a global configuration value):

gcloud config set app/cloud_build_timeout 1200  # 20 mins

Alternatively, to avoid Cloud Build and build locally:

make docker
docker tag playground:latest gcr.io/golang-org/playground:latest
docker push gcr.io/golang-org/playground:latest
gcloud --project=golang-org --account=you@google.com app deploy app.yaml --image-url=gcr.io/golang-org/playground:latest

Then:

gcloud --project=golang-org --account=you@google.com app deploy app.yaml

Contributing

To submit changes to this repository, see https://golang.org/doc/contribute.html.