Skip to content

Commit

Permalink
PostgreSQL deployment example (#3675)
Browse files Browse the repository at this point in the history
* Add example Dockerfile and docker-compose.yml

* Update CHANGELOG.md
  • Loading branch information
robstradling authored Nov 14, 2024
1 parent 374d040 commit d4964f4
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Storage

* Add PostgreSQL quota manager and storage backend by @robstradling in https://github.com/google/trillian/pull/3644
* PostgreSQL deployment example by @robstradling in https://github.com/google/trillian/pull/3675

### Misc

Expand Down
5 changes: 5 additions & 0 deletions examples/deployment/docker/db_server/postgresql/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM postgres:latest

# expects the build context to be: $GOPATH/src/github.com/google/trillian
COPY storage/postgresql/schema/storage.sql /docker-entrypoint-initdb.d/storage.sql
RUN chmod -R 775 /docker-entrypoint-initdb.d
52 changes: 52 additions & 0 deletions examples/deployment/postgresql/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
version: '3.1'
services:
postgresql:
build:
context: ../../..
dockerfile: examples/deployment/docker/db_server/postgresql/Dockerfile
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
- POSTGRESQL_DATABASE=defaultdb
- POSTGRESQL_USER=test
- POSTGRESQL_PASSWORD=zaphod
restart: always # keep the PostgreSQL server running
trillian-log-server:
build:
context: ../../..
dockerfile: examples/deployment/docker/log_server/Dockerfile
args:
- GOFLAGS
command: [
"--quota_system=postgresql",
"--storage_system=postgresql",
"--postgresql_uri=postgresql:///defaultdb?host=localhost&user=test&password=zaphod",
"--rpc_endpoint=0.0.0.0:8090",
"--http_endpoint=0.0.0.0:8091",
"--alsologtostderr",
]
restart: always # retry while PostgreSQL is starting up
ports:
- "8090:8090"
- "8091:8091"
depends_on:
- postgresql
trillian-log-signer:
build:
context: ../../..
dockerfile: examples/deployment/docker/log_signer/Dockerfile
args:
- GOFLAGS
command: [
"--quota_system=postgresql",
"--storage_system=postgresql",
"--postgresql_uri=postgresql:///defaultdb?host=localhost&user=test&password=zaphod",
"--rpc_endpoint=0.0.0.0:8090",
"--http_endpoint=0.0.0.0:8091",
"--force_master",
"--alsologtostderr",
]
restart: always # retry while PostgreSQL is starting up
ports:
- "8092:8091"
depends_on:
- postgresql

0 comments on commit d4964f4

Please sign in to comment.