Skip to content

Commit

Permalink
wait for kafka to start in deepfence_server
Browse files Browse the repository at this point in the history
  • Loading branch information
gnmahanth committed Dec 9, 2022
1 parent c893564 commit 289e868
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion deepfence_server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ENV POSTGRES_USER_DB_HOST=deepfence-postgres \
ADD deepfence_server/auth /auth
ADD deepfence_utils/postgresql /usr/local/postgresql-migrate
COPY deepfence_server/entrypoint.sh /entrypoint.sh
RUN apk add --no-cache --update bash curl libpcap tar \
RUN apk add --no-cache --update bash curl libpcap tar kafkacat \
&& apk add --no-cache postgresql-client --repository=https://dl-cdn.alpinelinux.org/alpine/v3.14/main \
&& chmod +x /entrypoint.sh \
&& curl -L "https://github.com/golang-migrate/migrate/releases/latest/download/migrate.linux-amd64.tar.gz" | tar xvz \
Expand Down
6 changes: 6 additions & 0 deletions deepfence_server/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ if [ ! $? -eq 0 ]; then
exit 1
fi

until kcat -L -b ${KAFKA_BROKERS};
do
echo >&2 "kafka is unavailable - sleeping"
sleep 5
done

sed -i "s/https:\/\/petstore.swagger.io\/v2\/swagger.json/\/deepfence\/openapi-docs/g" /usr/local/share/swagger-ui/swagger-initializer.js

exec "$@"

0 comments on commit 289e868

Please sign in to comment.