|
| 1 | +# SQL Stream Store Docker Container |
| 2 | + |
| 3 | +This container includes both the SQLStreamStore.Server and the user interface. The server runs on port 80 inside the container. |
| 4 | + |
| 5 | +As of this time, no `latest` tag is used. The following convention is used instead: `${version}-{runtime}` e.g., `1.2.0-alpine3.9`. |
| 6 | + |
| 7 | +## Getting Started |
| 8 | + |
| 9 | +```bash |
| 10 | +docker pull |
| 11 | +``` |
| 12 | + |
| 13 | +### Environment Variables |
| 14 | + |
| 15 | +Name|Description|Valid Values|Default |
| 16 | +---|---|---|--- |
| 17 | +SQLSTREAMSTORE_PROVIDER|The provider.|`inmemory`, `mssql`, `postgres`, `mysql`|`inmemory` |
| 18 | +SQLSTREAMSTORE_CONNECTION_STRING|The connection string. Not valid when provider=`inmemory`| |
| 19 | +SQLSTREAMSTORE_SCHEMA|The database schema. Not valid when provider=`inmemory, mysql`| |
| 20 | +SQLSTREAMSTORE_LOG_LEVEL|The log level.|`FATAL`, `ERROR`, `WARNING`, `INFORMATION`, `VERBOSE`|`INFORMATION` |
| 21 | +SQLSTREAMSTORE_DISABLE_DELETION_TRACKING|Records deleted streams and messages in a `$deleted` stream.|`true`,`false`|`false` |
| 22 | +SQLSTREAMSTORE_USE_CANONICAL_URIS|Maximize cache hits by sorting query string parameters. Do not use in environments where the query string is sorted by the host e.g. AWS API Gateway.|`true`, `false`|`false` |
| 23 | + |
| 24 | +### Commands |
| 25 | + |
| 26 | +Some helper commands are provided to help you initialize the database. |
| 27 | + |
| 28 | +Name|Description |
| 29 | +---|--- |
| 30 | +`init-database`|Creates a database (e.g., `CREATE DATABASE`) if you don't have one. |
| 31 | +`init`|Initializes the SQL Stream Store Schema. This includes any tables, indices, and stored procedures SQL Stream Store requires. |
| 32 | + |
| 33 | +### Examples |
| 34 | + |
| 35 | +#### Quickstart |
| 36 | +This runs in memory, so nothing is persisted. |
| 37 | +```bash |
| 38 | +docker run --rm -p 5000:80 sqlstreamstore/server:1.2.0-alpine3.9 |
| 39 | +``` |
| 40 | + |
| 41 | +#### Postgres w/ Verbose Logging |
| 42 | + |
| 43 | +```bash |
| 44 | +# Start a postgres container |
| 45 | +docker run -p 5432:5432 --rm --detach --name sss-postgres postgres:9.6 |
| 46 | + |
| 47 | +# Get its ip address to supply to the connection string |
| 48 | +docker inspect --format '{{ .NetworkSettings.IPAddress }}' sss-postgres # 172.17.0.3 |
| 49 | + |
| 50 | +# Create the database |
| 51 | +docker run --rm \ |
| 52 | + -e "SQLSTREAMSTORE_PROVIDER=postgres" \ |
| 53 | + -e "SQLSTREAMSTORE_CONNECTION_STRING=host=172.17.0.3;User Id=postgres;database=mydatabase" \ |
| 54 | + -e "SQLSTREAMSTORE_LOG_LEVEL=verbose" -e "SQLSTREAMSTORE_SCHEMA=public" \ |
| 55 | + -p 5000:80 \ |
| 56 | + sqlstreamstore/server:1.2.0-alpine3.9 init-database |
| 57 | + |
| 58 | +# Create all tables, indices, and functions |
| 59 | +docker run --rm \ |
| 60 | + -e "SQLSTREAMSTORE_PROVIDER=postgres" \ |
| 61 | + -e "SQLSTREAMSTORE_CONNECTION_STRING=host=172.17.0.3;User Id=postgres;database=mydatabase" \ |
| 62 | + -e "SQLSTREAMSTORE_LOG_LEVEL=verbose" -e "SQLSTREAMSTORE_SCHEMA=public" \ |
| 63 | + -p 5000:80 \ |
| 64 | + sqlstreamstore/server:1.2.0-alpine3.9 init |
| 65 | + |
| 66 | +# Run the server |
| 67 | +docker run --rm \ |
| 68 | + -e "SQLSTREAMSTORE_PROVIDER=postgres" \ |
| 69 | + -e "SQLSTREAMSTORE_CONNECTION_STRING=host=172.17.0.3;User Id=postgres;database=mydatabase" \ |
| 70 | + -e "SQLSTREAMSTORE_LOG_LEVEL=verbose" -e "SQLSTREAMSTORE_SCHEMA=public" \ |
| 71 | + -p 5000:80 \ |
| 72 | + sqlstreamstore/server:1.2.0-alpine3.9 |
| 73 | +``` |
0 commit comments