Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Dockerfile.db
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM mysql

ENV MYSQL_PASSWORD=zaphod \
MYSQL_USER=test \
MYSQL_DATABASE=test \
MYSQL_RANDOM_ROOT_PASSWORD=yes

ADD storage/mysql/storage.sql /docker-entrypoint-initdb.d/storage.sql
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this Dockerfile for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the Docker equivalent of ./script/resetdb since this particular mysql image runs all the sql scripts in /docker-entrypoint-initdb.d when it's being initialized.

30 changes: 30 additions & 0 deletions server/trillian_log_server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM golang

ENV DB_USER=test \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to use ARG rather than ENV, so that these values can be overridden when building the image. I'm ok with ENV though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ENV allows the arguments to be overridden at runtime which might be even more flexible than fixing them at build time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation suggests using both, by declaring an ARG first and then using its value to initialize the ENV. I'm fine with leaving it as it is though, just thought I'd highlight this option.

DB_PASSWORD=zaphod \
DB_DATABASE=test \
DB_HOST=127.0.0.0:3306

ENV HOST=0.0.0.0 \
RPC_PORT=8090 \
HTTP_PORT=8091

ENV DUMP_METRICS 0s

ADD . /go/src/github.com/google/trillian
WORKDIR /go/src/github.com/google/trillian

RUN go get -v ./server/trillian_log_server

ENTRYPOINT /go/bin/trillian_log_server \
--mysql_uri="${DB_USER}:${DB_PASSWORD}@tcp(${DB_HOST})/${DB_DATABASE}" \
--rpc_endpoint="$HOST:$RPC_PORT" \
--http_endpoint="$HOST:$HTTP_PORT" \
--dump_metrics_interval="$DUMP_METRICS" \
--alsologtostderr

EXPOSE $RPC_PORT
EXPOSE $HTTP_PORT

HEALTHCHECK --interval=5m --timeout=3s \
CMD curl -f http://localhost:$HTTP_PORT/debug/vars || exit 1
33 changes: 33 additions & 0 deletions server/trillian_log_signer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM golang

ENV DB_USER=test \
DB_PASSWORD=zaphod \
DB_DATABASE=test \
DB_HOST=127.0.0.0:3306

ENV HOST=0.0.0.0 \
HTTP_PORT=8091

ENV SEQUENCER_GUARD_WINDOW=0s \
DUMP_METRICS=0s \
FORCE_MASTER=true


ADD . /go/src/github.com/google/trillian
WORKDIR /go/src/github.com/google/trillian

RUN go get ./server/trillian_log_signer

# Run the outyet command by default when the container starts.
ENTRYPOINT /go/bin/trillian_log_signer \
--mysql_uri="${DB_USER}:${DB_PASSWORD}@tcp(${DB_HOST})/${DB_DATABASE}" \
--http_endpoint="$HOST:$HTTP_PORT" \
--dump_metrics_interval="$DUMP_METRICS" \
--sequencer_guard_window="$SEQUENCER_GUARD_WINDOW" \
--force_master="$FORCE_MASTER" \
--alsologtostderr

EXPOSE $HTTP_PORT

HEALTHCHECK --interval=5m --timeout=3s \
CMD curl -f http://localhost:$HTTP_PORT/debug/vars || exit 1
27 changes: 27 additions & 0 deletions server/vmap/trillian_map_server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM golang

ENV DB_USER=test \
DB_PASSWORD=zaphod \
DB_DATABASE=test \
DB_HOST=127.0.0.0:3306

ENV HOST=0.0.0.0 \
RPC_PORT=8090 \
HTTP_PORT=8091

ADD . /go/src/github.com/google/trillian
WORKDIR /go/src/github.com/google/trillian

RUN go get ./server/vmap/trillian_map_server

ENTRYPOINT /go/bin/trillian_map_server \
--mysql_uri="${DB_USER}:${DB_PASSWORD}@tcp(${DB_HOST})/${DB_DATABASE}" \
--rpc_endpoint="$HOST:$RPC_PORT" \
--http_endpoint="$HOST:$HTTP_PORT" \
--alsologtostderr

EXPOSE $HTTP_PORT

HEALTHCHECK --interval=5m --timeout=3s \
CMD curl -f http://localhost:$HTTP_PORT/debug/vars || exit 1