mirror of
https://github.com/pacnpal/simpleguardhome.git
synced 2025-12-20 04:21:13 -05:00
refactor(docker): restructure Dockerfile to copy source code directory and create rules_backup volume
This commit is contained in:
@@ -14,7 +14,10 @@ COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy source code
|
||||
COPY src/simpleguardhome /app/simpleguardhome/
|
||||
COPY src /app/src
|
||||
|
||||
# Create rules_backup directory with proper permissions
|
||||
RUN mkdir -p rules_backup && chmod 777 rules_backup
|
||||
|
||||
# Set up health check
|
||||
COPY healthcheck.py /usr/local/bin/
|
||||
@@ -35,3 +38,6 @@ COPY docker-entrypoint.sh /usr/local/bin/
|
||||
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
|
||||
# Mark rules_backup as a volume
|
||||
VOLUME ["/app/rules_backup"]
|
||||
@@ -3,5 +3,5 @@ set -e
|
||||
|
||||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting SimpleGuardHome..."
|
||||
|
||||
# Start the application
|
||||
exec python3 -m uvicorn simpleguardhome.main:app --host 0.0.0.0 --port 8000
|
||||
# Run the app with src in Python path to find the module
|
||||
PYTHONPATH=/app/src exec python3 -m uvicorn simpleguardhome.main:app --host 0.0.0.0 --port 8000
|
||||
Reference in New Issue
Block a user