# Services : GCloud : Cloud Run
## Jobs
#### Env Vars
The following env vars are automatically set inside a service container:
```
K_CONFIGURATION=web
K_REVISION=web-00002-7pl
K_SERVICE=web
PORT=8080 (default; configurable)
```
## Services
When the request timeout is reached, Google returns a 504 to the end user.
You must bind to 0.0.0.0 and listen on the default or configured port, which is stored in env var `PORT`.
If running a WSGI app, use this Dockerfile CMD instruction optimized for Cloud Run:
```Dockerfile
CMD exec gunicorn --bind :$PORT --workers 1 --threads 8 --timeout 0 path.to.module:app
```
#### Env Vars
The following env vars are automatically set inside a service container:
```
CLOUD_RUN_JOB ex: ???
CLOUD_RUN_EXECUTION ex: ???
CLOUD_RUN_TASK_INDEX Starts at 0 for the first task and increments by 1 for every successive task,
up to the maximum number of tasks minus 1.
If you set --parallelism to greater than 1, tasks might not follow the index order.
CLOUD_RUN_TASK_ATTEMPT Starts at 0 for the first attempt and increments by 1 for every successive retry,
up to the maximum retries value.
CLOUD_RUN_TASK_COUNT The number of tasks defined in the --tasks parameter.
```
#### Signals
The `SIGTERM` signal indicates 10s before shutdown, then `SIGKILL`.
## Instance Metadata Server
Instances expose a metadata server that you can use to retrieve details about your containers, such as the project ID, region, instance ID or service accounts. You can also use the metadata server to generate tokens for the service identity.
To access metadata server data, use HTTP requests to the `http://metadata.google.internal/` endpoint with the `Metadata-Flavor: Google` header.
## Logs
All instance logs for a service are combined into one.
Logs for all executions of a job are combined into one, which gets messy if you use the same job to do many different things using the `--args` override. However, you can also see just the log output of a particular execution.