diff options
author | Daniel GarcĂa <[email protected]> | 2020-07-06 18:15:18 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-06 18:15:18 +0200 |
commit | 5b620ba6cda3ae70e8661d134713bac531a251ff (patch) | |
tree | 7cf1e448280e5108604633c1f5666ea7f078c858 | |
parent | 596c9b869185a86d7619024066c80a008102199e (diff) | |
parent | d5f9b33f66c99103c0687f3adb08b1396d6dd1b7 (diff) | |
download | vaultwarden-5b620ba6cda3ae70e8661d134713bac531a251ff.tar.gz vaultwarden-5b620ba6cda3ae70e8661d134713bac531a251ff.zip |
Merge pull request #1048 from jjlin/init
Add startup script to support init operations
-rw-r--r-- | docker/Dockerfile.j2 | 3 | ||||
-rw-r--r-- | docker/aarch64/mysql/Dockerfile | 3 | ||||
-rw-r--r-- | docker/aarch64/sqlite/Dockerfile | 3 | ||||
-rw-r--r-- | docker/amd64/mysql/Dockerfile | 3 | ||||
-rw-r--r-- | docker/amd64/mysql/Dockerfile.alpine | 3 | ||||
-rw-r--r-- | docker/amd64/postgresql/Dockerfile | 3 | ||||
-rw-r--r-- | docker/amd64/postgresql/Dockerfile.alpine | 3 | ||||
-rw-r--r-- | docker/amd64/sqlite/Dockerfile | 3 | ||||
-rw-r--r-- | docker/amd64/sqlite/Dockerfile.alpine | 3 | ||||
-rw-r--r-- | docker/armv6/mysql/Dockerfile | 3 | ||||
-rw-r--r-- | docker/armv6/sqlite/Dockerfile | 3 | ||||
-rw-r--r-- | docker/armv7/mysql/Dockerfile | 3 | ||||
-rw-r--r-- | docker/armv7/sqlite/Dockerfile | 3 | ||||
-rwxr-xr-x | docker/start.sh | 15 |
14 files changed, 41 insertions, 13 deletions
diff --git a/docker/Dockerfile.j2 b/docker/Dockerfile.j2 index e67218c9..691f5fb3 100644 --- a/docker/Dockerfile.j2 +++ b/docker/Dockerfile.j2 @@ -288,9 +288,10 @@ COPY --from=build app/target/release/bitwarden_rs . {% endif %} COPY docker/healthcheck.sh /healthcheck.sh +COPY docker/start.sh /start.sh HEALTHCHECK --interval=60s --timeout=10s CMD ["/healthcheck.sh"] # Configures the startup! WORKDIR / -CMD ["/bitwarden_rs"] +CMD ["/start.sh"] diff --git a/docker/aarch64/mysql/Dockerfile b/docker/aarch64/mysql/Dockerfile index f8eac46f..8cd92867 100644 --- a/docker/aarch64/mysql/Dockerfile +++ b/docker/aarch64/mysql/Dockerfile @@ -125,9 +125,10 @@ COPY --from=vault /web-vault ./web-vault COPY --from=build /app/target/aarch64-unknown-linux-gnu/release/bitwarden_rs . COPY docker/healthcheck.sh /healthcheck.sh +COPY docker/start.sh /start.sh HEALTHCHECK --interval=60s --timeout=10s CMD ["/healthcheck.sh"] # Configures the startup! WORKDIR / -CMD ["/bitwarden_rs"] +CMD ["/start.sh"] diff --git a/docker/aarch64/sqlite/Dockerfile b/docker/aarch64/sqlite/Dockerfile index 8b5dbcba..449df5ec 100644 --- a/docker/aarch64/sqlite/Dockerfile +++ b/docker/aarch64/sqlite/Dockerfile @@ -119,9 +119,10 @@ COPY --from=vault /web-vault ./web-vault COPY --from=build /app/target/aarch64-unknown-linux-gnu/release/bitwarden_rs . COPY docker/healthcheck.sh /healthcheck.sh +COPY docker/start.sh /start.sh HEALTHCHECK --interval=60s --timeout=10s CMD ["/healthcheck.sh"] # Configures the startup! WORKDIR / -CMD ["/bitwarden_rs"] +CMD ["/start.sh"] diff --git a/docker/amd64/mysql/Dockerfile b/docker/amd64/mysql/Dockerfile index dbf6ffee..88e289fa 100644 --- a/docker/amd64/mysql/Dockerfile +++ b/docker/amd64/mysql/Dockerfile @@ -93,9 +93,10 @@ COPY --from=vault /web-vault ./web-vault COPY --from=build app/target/release/bitwarden_rs . COPY docker/healthcheck.sh /healthcheck.sh +COPY docker/start.sh /start.sh HEALTHCHECK --interval=60s --timeout=10s CMD ["/healthcheck.sh"] # Configures the startup! WORKDIR / -CMD ["/bitwarden_rs"] +CMD ["/start.sh"] diff --git a/docker/amd64/mysql/Dockerfile.alpine b/docker/amd64/mysql/Dockerfile.alpine index d7991090..f0733c37 100644 --- a/docker/amd64/mysql/Dockerfile.alpine +++ b/docker/amd64/mysql/Dockerfile.alpine @@ -96,9 +96,10 @@ COPY --from=vault /web-vault ./web-vault COPY --from=build /app/target/x86_64-unknown-linux-musl/release/bitwarden_rs . COPY docker/healthcheck.sh /healthcheck.sh +COPY docker/start.sh /start.sh HEALTHCHECK --interval=60s --timeout=10s CMD ["/healthcheck.sh"] # Configures the startup! WORKDIR / -CMD ["/bitwarden_rs"] +CMD ["/start.sh"] diff --git a/docker/amd64/postgresql/Dockerfile b/docker/amd64/postgresql/Dockerfile index 5e45a90b..3a51b048 100644 --- a/docker/amd64/postgresql/Dockerfile +++ b/docker/amd64/postgresql/Dockerfile @@ -93,9 +93,10 @@ COPY --from=vault /web-vault ./web-vault COPY --from=build app/target/release/bitwarden_rs . COPY docker/healthcheck.sh /healthcheck.sh +COPY docker/start.sh /start.sh HEALTHCHECK --interval=60s --timeout=10s CMD ["/healthcheck.sh"] # Configures the startup! WORKDIR / -CMD ["/bitwarden_rs"] +CMD ["/start.sh"] diff --git a/docker/amd64/postgresql/Dockerfile.alpine b/docker/amd64/postgresql/Dockerfile.alpine index cdc2d029..984a8a7b 100644 --- a/docker/amd64/postgresql/Dockerfile.alpine +++ b/docker/amd64/postgresql/Dockerfile.alpine @@ -96,9 +96,10 @@ COPY --from=vault /web-vault ./web-vault COPY --from=build /app/target/x86_64-unknown-linux-musl/release/bitwarden_rs . COPY docker/healthcheck.sh /healthcheck.sh +COPY docker/start.sh /start.sh HEALTHCHECK --interval=60s --timeout=10s CMD ["/healthcheck.sh"] # Configures the startup! WORKDIR / -CMD ["/bitwarden_rs"] +CMD ["/start.sh"] diff --git a/docker/amd64/sqlite/Dockerfile b/docker/amd64/sqlite/Dockerfile index 8bd2f7fc..fe9cecb1 100644 --- a/docker/amd64/sqlite/Dockerfile +++ b/docker/amd64/sqlite/Dockerfile @@ -87,9 +87,10 @@ COPY --from=vault /web-vault ./web-vault COPY --from=build app/target/release/bitwarden_rs . COPY docker/healthcheck.sh /healthcheck.sh +COPY docker/start.sh /start.sh HEALTHCHECK --interval=60s --timeout=10s CMD ["/healthcheck.sh"] # Configures the startup! WORKDIR / -CMD ["/bitwarden_rs"] +CMD ["/start.sh"] diff --git a/docker/amd64/sqlite/Dockerfile.alpine b/docker/amd64/sqlite/Dockerfile.alpine index 7b0d03bf..2dce0cf7 100644 --- a/docker/amd64/sqlite/Dockerfile.alpine +++ b/docker/amd64/sqlite/Dockerfile.alpine @@ -90,9 +90,10 @@ COPY --from=vault /web-vault ./web-vault COPY --from=build /app/target/x86_64-unknown-linux-musl/release/bitwarden_rs . COPY docker/healthcheck.sh /healthcheck.sh +COPY docker/start.sh /start.sh HEALTHCHECK --interval=60s --timeout=10s CMD ["/healthcheck.sh"] # Configures the startup! WORKDIR / -CMD ["/bitwarden_rs"] +CMD ["/start.sh"] diff --git a/docker/armv6/mysql/Dockerfile b/docker/armv6/mysql/Dockerfile index 7599cd5c..fad45f33 100644 --- a/docker/armv6/mysql/Dockerfile +++ b/docker/armv6/mysql/Dockerfile @@ -125,9 +125,10 @@ COPY --from=vault /web-vault ./web-vault COPY --from=build /app/target/arm-unknown-linux-gnueabi/release/bitwarden_rs . COPY docker/healthcheck.sh /healthcheck.sh +COPY docker/start.sh /start.sh HEALTHCHECK --interval=60s --timeout=10s CMD ["/healthcheck.sh"] # Configures the startup! WORKDIR / -CMD ["/bitwarden_rs"] +CMD ["/start.sh"] diff --git a/docker/armv6/sqlite/Dockerfile b/docker/armv6/sqlite/Dockerfile index 935e2d6e..1bc37aff 100644 --- a/docker/armv6/sqlite/Dockerfile +++ b/docker/armv6/sqlite/Dockerfile @@ -119,9 +119,10 @@ COPY --from=vault /web-vault ./web-vault COPY --from=build /app/target/arm-unknown-linux-gnueabi/release/bitwarden_rs . COPY docker/healthcheck.sh /healthcheck.sh +COPY docker/start.sh /start.sh HEALTHCHECK --interval=60s --timeout=10s CMD ["/healthcheck.sh"] # Configures the startup! WORKDIR / -CMD ["/bitwarden_rs"] +CMD ["/start.sh"] diff --git a/docker/armv7/mysql/Dockerfile b/docker/armv7/mysql/Dockerfile index fd242aaa..89da407a 100644 --- a/docker/armv7/mysql/Dockerfile +++ b/docker/armv7/mysql/Dockerfile @@ -124,9 +124,10 @@ COPY --from=vault /web-vault ./web-vault COPY --from=build /app/target/armv7-unknown-linux-gnueabihf/release/bitwarden_rs . COPY docker/healthcheck.sh /healthcheck.sh +COPY docker/start.sh /start.sh HEALTHCHECK --interval=60s --timeout=10s CMD ["/healthcheck.sh"] # Configures the startup! WORKDIR / -CMD ["/bitwarden_rs"] +CMD ["/start.sh"] diff --git a/docker/armv7/sqlite/Dockerfile b/docker/armv7/sqlite/Dockerfile index 08d46cf7..cf20a39e 100644 --- a/docker/armv7/sqlite/Dockerfile +++ b/docker/armv7/sqlite/Dockerfile @@ -118,9 +118,10 @@ COPY --from=vault /web-vault ./web-vault COPY --from=build /app/target/armv7-unknown-linux-gnueabihf/release/bitwarden_rs . COPY docker/healthcheck.sh /healthcheck.sh +COPY docker/start.sh /start.sh HEALTHCHECK --interval=60s --timeout=10s CMD ["/healthcheck.sh"] # Configures the startup! WORKDIR / -CMD ["/bitwarden_rs"] +CMD ["/start.sh"] diff --git a/docker/start.sh b/docker/start.sh new file mode 100755 index 00000000..39f591c2 --- /dev/null +++ b/docker/start.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +if [ -r /etc/bitwarden_rs.sh ]; then + . /etc/bitwarden_rs.sh +fi + +if [ -d /etc/bitwarden_rs.d ]; then + for f in /etc/bitwarden_rs.d/*.sh; do + if [ -r $f ]; then + . $f + fi + done +fi + +exec /bitwarden_rs "${@}" |