sandbox: deploy to module, enable autoscaling, increase timeout

We're seeing more "process took too long" errors running on
Managed VMs. Hopefully with more instances and a longer timeout
these issues should go away.

Change-Id: I90f90e4714395a782e399c31f9f67396ca3ae33d
Reviewed-on: https://go-review.googlesource.com/14749
Reviewed-by: Andrew Gerrand <adg@golang.org>
diff --git a/sandbox/Dockerfile b/sandbox/Dockerfile
index 032a5b6..bec94c5 100644
--- a/sandbox/Dockerfile
+++ b/sandbox/Dockerfile
@@ -43,5 +43,8 @@
 ADD . /go/src/sandbox/
 RUN go install sandbox
 
+# make sure it works
+RUN /go/bin/sandbox test
+
 EXPOSE 8080
 ENTRYPOINT ["/go/bin/sandbox"]
diff --git a/sandbox/app.yaml b/sandbox/app.yaml
index cf9e256..200b8f9 100644
--- a/sandbox/app.yaml
+++ b/sandbox/app.yaml
@@ -1,11 +1,11 @@
-application: golang-org
+module: sandbox
 runtime: custom
 api_version: go1
 vm: true
-module: sandbox
 
-manual_scaling:
-  instances: 5
+automatic_scaling:
+  min_num_instances: 5
+  max_num_instances: 20
 
 health_check:
   check_interval_sec: 20
diff --git a/sandbox/sandbox.go b/sandbox/sandbox.go
index 7ea6bef..0c562dc 100644
--- a/sandbox/sandbox.go
+++ b/sandbox/sandbox.go
@@ -26,7 +26,7 @@
 	"time"
 )
 
-const maxRunTime = 500 * time.Millisecond
+const maxRunTime = 2 * time.Second
 
 type Request struct {
 	Body string