-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathentrypoint.sh
More file actions
28 lines (23 loc) · 934 Bytes
/
entrypoint.sh
File metadata and controls
28 lines (23 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash
set -e
ENV_KEYS_PATH=${ENV_KEYS_PATH:-"env/.env.keys"}
# If you have a "requirements.txt" in a mounted volume, you can install it here:
if [ -f "/app/tools/requirements.txt" ]; then
echo "Installing additional dependencies from /app/tools/requirements.txt..."
pip install --no-cache-dir -r /app/tools/requirements.txt
fi
# Check and run initialization scripts if they exist
if [ -f "/app/scripts/init.sh" ]; then
echo "Running initialization script /app/scripts/init.sh..."
bash /app/scripts/init.sh
elif [ -f "/app/scripts/init.py" ]; then
echo "Running initialization script /app/scripts/init.py..."
python /app/scripts/init.py
fi
echo "Waiting for keys file ${ENV_KEYS_PATH} to be created..."
while [ ! -f "$ENV_KEYS_PATH" ]; do
sleep 1
done
echo "${ENV_KEYS_PATH} found! Starting service..."
# Finally, run the main container command (passed as CMD in the Dockerfile).
exec "$@"