Skip to content
Open
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
26 changes: 24 additions & 2 deletions web3signer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,28 @@ x-logging: &logging
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

services:
w3s-init:
restart: "no"
build:
context: ./web3signer
args:
- DOCKER_TAG=${W3S_DOCKER_TAG:-latest}
- DOCKER_REPO=${W3S_DOCKER_REPO:-consensys/web3signer}
dockerfile: Dockerfile.init
image: w3s-init:local
pull_policy: never
depends_on:
postgres:
condition: service_healthy
<<: *logging
entrypoint:
- /flyway/flyway
- migrate
- -url=jdbc:postgresql://${PG_ALIAS}/web3signer
- -user=postgres
- -password=postgres
- -locations=filesystem:/tmp/web3signer

web3signer:
restart: "unless-stopped"
build:
Expand All @@ -31,8 +53,8 @@ services:
# This allows multiple Eth Docker stacks all connected to the same bridge network
- ${W3S_ALIAS:-${NETWORK}-web3signer}
depends_on:
postgres:
condition: service_healthy
w3s-init:
condition: service_completed_successfully
<<: *logging
entrypoint:
- docker-entrypoint.sh
Expand Down
6 changes: 0 additions & 6 deletions web3signer/Dockerfile.binary
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
ARG DOCKER_TAG=latest
ARG DOCKER_REPO=consensys/web3signer

FROM flyway/flyway:latest AS flyway

FROM ${DOCKER_REPO}:${DOCKER_TAG}

ARG USER=web3signer
Expand All @@ -27,10 +25,6 @@ COPY --chown=${USER}:${USER} ./docker-entrypoint.sh /usr/local/bin/
# Belt and suspenders
RUN chmod -R 755 /usr/local/bin/*

# Flyway for initial migrations

COPY --from=flyway --chown=${USER}:${USER} /flyway /flyway

USER ${USER}

ENTRYPOINT ["/opt/web3signer/bin/web3signer"]
9 changes: 9 additions & 0 deletions web3signer/Dockerfile.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# hadolint global ignore=DL3007,DL3008,DL3059
ARG DOCKER_TAG=latest
ARG DOCKER_REPO=consensys/web3signer

FROM ${DOCKER_REPO}:${DOCKER_TAG} AS web3signer

FROM flyway/flyway:latest

COPY --from=web3signer /opt/web3signer/migrations/postgresql /tmp/web3signer
2 changes: 0 additions & 2 deletions web3signer/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ if [[ -f /var/lib/web3signer/.migration_fatal_error ]]; then
exit 1
fi

/flyway/flyway migrate -url="jdbc:postgresql://${PG_ALIAS}/web3signer" -user=postgres -password=postgres -locations=filesystem:/opt/web3signer/migrations/postgresql

# Word splitting is desired for the command line parameters
# shellcheck disable=SC2086
exec "$@" ${__network}