This application demonstrates database usage within a Golang application using Postgres.
docker run gcr.io/twelvefactor/twelvefactor_databasesThese are configuration variables that can be passed to the docker container.
| Key | Description | Default |
|---|---|---|
| PORT | The port on 127.0.0.1 from which this application will serve. | 9090 |
| PING_PATH | The URL path at which to serve responses | /ping |
| PING_RESPONSE | The string response returned by a GET request to /ping | PONG |
| REQ_TIMEOUT | Request Timeout in Milliseconds | 500 |
| SERVER_READ_TIMEOUT | Server Read Timeout in Milliseconds | 1000 |
| SERVER_WRITE_TIMEOUT | Server Write Timeout in Milliseconds | 2000 |
| DB_CONN_MAX_LIFETIME | Max duration of a database connection | unlimited |
| DB_MAX_OPEN | Max open database connections | unlimited |
| DB_MAX_IDLE | Max idle database connections | 2 |
| POSTGRES_URI | Database connection URI | postgresql://postgres@localhost:5432/postgres?sslmode=disable |
| USERS_PATH | Path to expose the users service | /users |
| USERS_SELECT_LIMIT | The number of users to return from a GET request to the USERS_PATH | 10 |