test2 / entrypoint.sh
pannman
Disable Poetry virtual environment creation
c0fe430
raw
history blame contribute delete
747 Bytes
#!/bin/bash
cd /root
# Check for pyproject.toml
[ ! -f pyproject.toml ] && { echo "ERROR: pyproject.toml not found."; exit 1; }
if [ -f poetry.lock ]; then
echo "poetry.lock found. "
echo "Checking poetry.lock consistency..."
poetry config virtualenvs.create false
poetry check --lock || echo "WARNING: poetry.lock is out of date. Run 'poetry lock' to update."
echo "Proceeding with installation..."
poetry install --no-root
if [ $? -eq 0 ]; then
echo "Dependencies installed successfully from poetry.lock"
else
echo "ERROR: Failed to install dependencies from poetry.lock"
exit 1
fi
else
echo "WARNING: poetry.lock not found. Run 'poetry lock' to create it."
fi
exec /bin/bash