Permalink
Browse files

Support testing with docker (#1198)

* Split docker-compose into dev and prod configurations

* Update Readme
  • Loading branch information...
gdbelvin committed Feb 8, 2019
1 parent 5ac39fe commit 06aca6683ffb3d485d4937469d29bb125218210d
Showing with 24 additions and 23 deletions.
  1. +8 −22 README.md
  2. +8 −0 docker-compose.override.yml
  3. +8 −0 docker-compose.prod.yml
  4. +0 −1 docker-compose.yml
@@ -87,35 +87,20 @@ NB A default for the Key Transparency server URL is being used here. The default

## Running the server

### Install
1. [OpenSSL](https://www.openssl.org/community/binaries.html)
1. [Docker](https://docs.docker.com/engine/installation/)
- Docker Engine 1.13.0+ `docker version -f '{{.Server.APIVersion}}'`
- Docker Compose 1.11.0+ `docker-compose --version`
1. `go get -u github.com/google/keytransparency/...`
1. `go get -u github.com/google/trillian/...`
1. `./scripts/prepare_server.sh -f`

### Run
1. Run Key Transparency

```sh
$ cd $GOPATH/src/github.com/google/keytransparency
$ docker-compose up -d
Creating keytransparency_db_1 ... done
Creating keytransparency_map_server_1 ... done
Creating keytransparency_log_server_1 ... done
Creating keytransparency_log_server_1 ... done
Creating keytransparency_server_1 ... done
Creating keytransparency_sequencer_1 ... done
Creating keytransparency_monitor_1 ... done
Creating keytransparency_init_1 ... done
Creating keytransparency_prometheus_1 ... done
Creating keytransparency_monitor_1 ... done
```
```sh
go get -u github.com/google/keytransparency/...
go get -u github.com/google/trillian/...
cd $(go env GOPATH)/src/github.com/google/keytransparency
./scripts/prepare_server.sh -f
docker-compose up -f docker-compose.yml docker-compose.prod.yml
```

2. Watch it Run
- `docker-compose logs --tail=0 --follow`
- [Proof for foo@bar.com](https://localhost/v1/directories/default/users/foo@bar.com)
- [Server configuration info](https://localhost/v1/directories/default)

@@ -124,6 +109,7 @@ Key Transparency and its [Trillian](https://github.com/google/trillian) backend
use a [MySQL database](https://github.com/google/trillian/blob/master/README.md#mysql-setup),
which must be setup in order for the Key Transparency tests to work.

`docker-compose up -d db` will launch the database in the background.

### Directory structure

@@ -0,0 +1,8 @@
# Development configuration
# docker-compose up will automatically find and apply this configuration

version: "3"
services:
db:
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
@@ -0,0 +1,8 @@
# Production configuration
# docker-compose up -f docker-compose.yml docker-compose.prod.yml

version: "3"
services:
db:
environment:
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
@@ -41,7 +41,6 @@ services:
MYSQL_PASSWORD: zaphod
MYSQL_USER: test
MYSQL_DATABASE: test
MYSQL_RANDOM_ROOT_PASSWORD: "yes"

log-server:
depends_on:

0 comments on commit 06aca66

Please sign in to comment.