-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PostgreSQL deployment example (#3675)
* Add example Dockerfile and docker-compose.yml * Update CHANGELOG.md
- Loading branch information
1 parent
374d040
commit d4964f4
Showing
3 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |