-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request - improve Cassandra init by using a dedicated buil…
…d step chore: improve Cassandra init by using a dedicated build step
- Loading branch information
Showing
3 changed files
with
18 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Use a minimal Python image | ||
FROM python:3.9-slim-buster | ||
|
||
# Install required packages | ||
RUN apt-get update && apt-get install -y netcat-openbsd && \ | ||
pip install cassandra-driver | ||
|
||
# Set working directory | ||
WORKDIR /scripts | ||
|
||
# Copy init script into container | ||
COPY init_cassandra.py /scripts/init_cassandra.py | ||
|
||
# Entrypoint command: wait for Cassandra to be ready, then execute the script | ||
CMD sh -c "while ! nc -zv cassandra 9042; do echo 'Waiting for Cassandra...'; sleep 1; done; python3 /scripts/init_cassandra.py" |