mirror of
https://github.com/pacnpal/simpleguardhome.git
synced 2025-12-20 04:21:13 -05:00
feat(docker): enhance package installation verification and streamline entrypoint script
This commit is contained in:
13
Dockerfile
13
Dockerfile
@@ -19,14 +19,11 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|||||||
# Copy the source code
|
# Copy the source code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Set Python path to include src directory
|
# Clean any previous installations and install the package
|
||||||
ENV PYTHONPATH=/app/src
|
RUN pip uninstall -y simpleguardhome || true && \
|
||||||
|
pip install -e . && \
|
||||||
# Install the package in editable mode
|
pip show simpleguardhome && \
|
||||||
RUN pip install -e .
|
python3 -c "import simpleguardhome; print('Package found at:', simpleguardhome.__file__)"
|
||||||
|
|
||||||
# Verify package installation
|
|
||||||
RUN pip show simpleguardhome
|
|
||||||
|
|
||||||
# Copy and set up entrypoint script
|
# Copy and set up entrypoint script
|
||||||
COPY docker-entrypoint.sh /usr/local/bin/
|
COPY docker-entrypoint.sh /usr/local/bin/
|
||||||
|
|||||||
@@ -12,9 +12,13 @@ handle_term() {
|
|||||||
# Set up signal handlers
|
# Set up signal handlers
|
||||||
trap handle_term SIGTERM SIGINT
|
trap handle_term SIGTERM SIGINT
|
||||||
|
|
||||||
|
# Verify package can be imported
|
||||||
|
echo "Verifying package installation..."
|
||||||
|
python3 -c "import simpleguardhome" || exit 1
|
||||||
|
|
||||||
# Start the application
|
# Start the application
|
||||||
echo "Starting SimpleGuardHome server..."
|
echo "Starting SimpleGuardHome server..."
|
||||||
cd /app && PYTHONPATH=/app/src python3 -m simpleguardhome.main &
|
exec python3 -m simpleguardhome.main
|
||||||
|
|
||||||
# Store child PID
|
# Store child PID
|
||||||
child=$!
|
child=$!
|
||||||
|
|||||||
3
setup.py
3
setup.py
@@ -3,7 +3,8 @@ from setuptools import setup, find_packages
|
|||||||
setup(
|
setup(
|
||||||
name="simpleguardhome",
|
name="simpleguardhome",
|
||||||
version="0.1.0",
|
version="0.1.0",
|
||||||
packages=find_packages(),
|
packages=find_packages(where="src"),
|
||||||
|
package_dir={"": "src"},
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
package_data={
|
package_data={
|
||||||
"simpleguardhome": ["templates/*"]
|
"simpleguardhome": ["templates/*"]
|
||||||
|
|||||||
Reference in New Issue
Block a user