mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 15:35:35 +01:00
Add vault
This commit is contained in:
@@ -10,12 +10,15 @@ RUN cargo build --release --bin book_bot
|
|||||||
FROM debian:bullseye-slim
|
FROM debian:bullseye-slim
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y openssl ca-certificates \
|
&& apt-get install -y openssl ca-certificates curl jq \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN update-ca-certificates
|
RUN update-ca-certificates
|
||||||
|
|
||||||
|
COPY ./scripts/*.sh /
|
||||||
|
RUN chmod +x /*.sh
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY --from=builder /app/target/release/book_bot /usr/local/bin
|
COPY --from=builder /app/target/release/book_bot /usr/local/bin
|
||||||
ENTRYPOINT ["/usr/local/bin/book_bot"]
|
ENTRYPOINT ["/start.sh"]
|
||||||
|
|||||||
7
scripts/env.sh
Normal file
7
scripts/env.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#! /usr/bin/env sh
|
||||||
|
|
||||||
|
response=`curl -X 'GET' "https://$VAULT_HOST/v1/$VAULT_SECRET_PATH" -s \
|
||||||
|
-H 'accept: application/json' \
|
||||||
|
-H "X-Vault-Token: $VAULT_TOKEN"`
|
||||||
|
|
||||||
|
echo "$(echo "$response" | jq -r '.data.data | to_entries | map("\(.key)=\(.value)") | .[]')"
|
||||||
5
scripts/start.sh
Normal file
5
scripts/start.sh
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#! /usr/bin/env sh
|
||||||
|
|
||||||
|
export $(/env.sh)
|
||||||
|
|
||||||
|
exec /usr/local/bin/book_bot
|
||||||
Reference in New Issue
Block a user