mirror of
https://gitlab.com/fabinfra/fabaccess/bffh.git
synced 2024-11-11 01:53:23 +01:00
added first start logic to seed db and keep state
This commit is contained in:
parent
76a1def456
commit
ab3ac8f730
@ -15,10 +15,11 @@ FROM debian:buster-slim
|
|||||||
RUN apt-get update && apt-get upgrade -yqq
|
RUN apt-get update && apt-get upgrade -yqq
|
||||||
RUN apt-get install -yqq libgsasl7 && rm -rf /var/lib/apt/lists/*
|
RUN apt-get install -yqq libgsasl7 && rm -rf /var/lib/apt/lists/*
|
||||||
COPY --from=builder /usr/local/cargo/bin/diflouroborane /usr/local/bin/diflouroborane
|
COPY --from=builder /usr/local/cargo/bin/diflouroborane /usr/local/bin/diflouroborane
|
||||||
|
COPY ./docker/startup.sh /startup.sh
|
||||||
#COPY --from=builder /usr/src/bffh/examples/bffh.dhall /etc/diflouroborane.dhall
|
#COPY --from=builder /usr/src/bffh/examples/bffh.dhall /etc/diflouroborane.dhall
|
||||||
# RUN diflouroborane --print-default > /etc/diflouroborane.toml
|
# RUN diflouroborane --print-default > /etc/diflouroborane.toml
|
||||||
VOLUME /etc/bffh/
|
VOLUME /etc/bffh/
|
||||||
VOLUME /var/lib/bffh/
|
VOLUME /var/lib/bffh/
|
||||||
VOLUME /usr/local/lib/bffh/adapters/
|
VOLUME /usr/local/lib/bffh/adapters/
|
||||||
EXPOSE 59661
|
EXPOSE 59661
|
||||||
ENTRYPOINT ["sh", "-c", "diflouroborane -c /etc/bffh/bffh.dhall --load=/etc/bffh; diflouroborane -c /etc/bffh/bffh.dhall"]
|
ENTRYPOINT ["/bin/bash", "/startup.sh"]
|
||||||
|
10
docker/startup.sh
Normal file
10
docker/startup.sh
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
CONTAINER_ALREADY_STARTED="/var/lib/bffh/firststartflag"
|
||||||
|
if [ ! -e $CONTAINER_ALREADY_STARTED ]; then
|
||||||
|
touch $CONTAINER_ALREADY_STARTED
|
||||||
|
echo "-- Seeding Database --"
|
||||||
|
diflouroborane -c /etc/bffh/bffh.dhall --load=/etc/bffh
|
||||||
|
else
|
||||||
|
diflouroborane -c /etc/bffh/bffh.dhall
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user