mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-05-13 07:03:58 +00:00
Fix persistent volume check
It seemed there were some issues building the cross-platform images. This PR fixes #2501 so building the containers will work again.
This commit is contained in:
parent
5845ed2c92
commit
a85a250dfd
17 changed files with 153 additions and 102 deletions
|
@ -104,6 +104,14 @@ RUN touch src/main.rs
|
|||
# hadolint ignore=DL3059
|
||||
RUN cargo build --features ${DB} --release --target=armv7-unknown-linux-gnueabihf
|
||||
|
||||
# Create a special empty file which we check within the application.
|
||||
# If this file exists, then we exit Vaultwarden to prevent data loss when someone forgets to use volumes.
|
||||
# If you really really want to use volatile storage you can set the env `I_REALLY_WANT_VOLATILE_STORAGE=true`
|
||||
# This file should disappear if a volume is mounted on-top of this using a docker volume.
|
||||
# We run this in the build image and copy it over, because the runtime image could be missing some executables.
|
||||
# hadolint ignore=DL3059
|
||||
RUN touch /vaultwarden_docker_persistent_volume_check
|
||||
|
||||
######################## RUNTIME IMAGE ########################
|
||||
# Create a new stage with a minimal image
|
||||
# because we already have a binary built
|
||||
|
@ -136,16 +144,11 @@ VOLUME /data
|
|||
EXPOSE 80
|
||||
EXPOSE 3012
|
||||
|
||||
# Create a special empty file which we check within the application.
|
||||
# If this file exists, then we exit Vaultwarden to prevent data loss when someone forgets to use volumes.
|
||||
# If you really really want to use volatile storage you can set the env `I_REALLY_WANT_VOLATILE_STORAGE=true`
|
||||
# This file should disappear if a volume is mounted on-top of this using a docker volume.
|
||||
RUN touch /data/vaultwarden_docker_persistent_volume_check
|
||||
|
||||
# Copies the files from the context (Rocket.toml file and web-vault)
|
||||
# and the binary from the "build" stage to the current stage
|
||||
WORKDIR /
|
||||
COPY --from=vault /web-vault ./web-vault
|
||||
COPY --from=build /vaultwarden_docker_persistent_volume_check /data/vaultwarden_docker_persistent_volume_check
|
||||
COPY --from=build /app/target/armv7-unknown-linux-gnueabihf/release/vaultwarden .
|
||||
|
||||
COPY docker/healthcheck.sh /healthcheck.sh
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue