Fixing error on device
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
FROM python:3.11-slim
|
FROM python:3.11-slim
|
||||||
|
|
||||||
# Set maintainer
|
# Set maintainer
|
||||||
LABEL maintainer="your-email@example.com"
|
LABEL maintainer="fuh@fuhlig.de"
|
||||||
LABEL description="PY_ChatBot - Modern Flask-based Chatbot Application"
|
LABEL description="PY_ChatBot - Modern Flask-based Chatbot Application"
|
||||||
|
|
||||||
# Set environment variables
|
# Set environment variables
|
||||||
@@ -57,4 +57,4 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
|
|||||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||||
|
|
||||||
# Default command
|
# Default command
|
||||||
CMD ["python", "main.py"]
|
CMD ["python", "main.py"]
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
# Main ChatBot Application
|
|
||||||
chatbot:
|
chatbot:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
container_name: py_chatbot
|
container_name: py_chatbot
|
||||||
@@ -12,13 +11,13 @@ services:
|
|||||||
# Database Configuration
|
# Database Configuration
|
||||||
- DB_TYPE=sqlite
|
- DB_TYPE=sqlite
|
||||||
- SQLITE_PATH=/app/data/chatbot.db
|
- SQLITE_PATH=/app/data/chatbot.db
|
||||||
|
|
||||||
# Flask Configuration
|
# Flask Configuration
|
||||||
- FLASK_HOST=0.0.0.0
|
- FLASK_HOST=0.0.0.0
|
||||||
- FLASK_PORT=8080
|
- FLASK_PORT=8080
|
||||||
- FLASK_DEBUG=false
|
- FLASK_DEBUG=false
|
||||||
- FLASK_SECRET_KEY=your-super-secret-key-change-this-in-production
|
- FLASK_SECRET_KEY=your-super-secret-key-change-this-in-production
|
||||||
|
|
||||||
# Session Configuration
|
# Session Configuration
|
||||||
- SESSION_LIFETIME_HOURS=24
|
- SESSION_LIFETIME_HOURS=24
|
||||||
- SESSION_COOKIE_SECURE=false
|
- SESSION_COOKIE_SECURE=false
|
||||||
@@ -36,22 +35,34 @@ services:
|
|||||||
retries: 3
|
retries: 3
|
||||||
start_period: 30s
|
start_period: 30s
|
||||||
|
|
||||||
# Optional: PostgreSQL Database (for production)
|
postgres:
|
||||||
#postgres:
|
image: postgres:15-alpine
|
||||||
# image: postgres:15-alpine
|
container_name: py_chatbot_postgres
|
||||||
# container_name: py_chatbot_postgres
|
restart: unless-stopped
|
||||||
# restart: unless-stopped
|
environment:
|
||||||
# environment:
|
- POSTGRES_DB=chatbot
|
||||||
# - POSTGRES_DB=chatbot
|
- POSTGRES_USER=chatbot_user
|
||||||
# - POSTGRES_USER=chatbot_user
|
- POSTGRES_PASSWORD=secure_password_change_this
|
||||||
# - POSTGRES_PASSWORD=secure_password_change_this
|
volumes:
|
||||||
# volumes:
|
- postgres_data:/var/lib/postgresql/data
|
||||||
# - postgres_data:/var/lib/postgresql/data
|
- ./init.sql:/docker-entrypoint-initdb.d/init.sql:ro
|
||||||
# - ./init.sql:/docker-entrypoint-initdb.d/init.sql:ro
|
networks:
|
||||||
# networks:
|
- chatbot_network
|
||||||
# - chatbot_network
|
profiles:
|
||||||
# profiles:
|
- postgres
|
||||||
# - postgres
|
|
||||||
|
# Optional: Redis for Session Storage
|
||||||
|
redis:
|
||||||
|
image: redis:7-alpine
|
||||||
|
container_name: py_chatbot_redis
|
||||||
|
restart: unless-stopped
|
||||||
|
command: redis-server --appendonly yes --requirepass secure_redis_password_change_this
|
||||||
|
volumes:
|
||||||
|
- redis_data:/data
|
||||||
|
networks:
|
||||||
|
- chatbot_network
|
||||||
|
profiles:
|
||||||
|
- redis
|
||||||
|
|
||||||
# Named Volumes
|
# Named Volumes
|
||||||
volumes:
|
volumes:
|
||||||
@@ -59,10 +70,12 @@ volumes:
|
|||||||
driver: local
|
driver: local
|
||||||
chatbot_logs:
|
chatbot_logs:
|
||||||
driver: local
|
driver: local
|
||||||
#postgres_data:
|
postgres_data:
|
||||||
# driver: local
|
driver: local
|
||||||
|
redis_data:
|
||||||
|
driver: local
|
||||||
|
|
||||||
# Networks
|
# Networks
|
||||||
networks:
|
networks:
|
||||||
chatbot_network:
|
chatbot_network:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
|||||||
@@ -2,9 +2,10 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
echo "🤖 Starting PY_ChatBot..."
|
echo "🤖 Starting PY_ChatBot..."
|
||||||
|
# Create directory for database dynamically based on SQLITE_PATH
|
||||||
|
|
||||||
# Create directories if they don't exist
|
DB_DIR=$(dirname "$SQLITE_PATH")
|
||||||
mkdir -p /app/databases /app/logs
|
mkdir -p "$DB_DIR" /app/logs
|
||||||
|
|
||||||
# Set default environment variables if not provided
|
# Set default environment variables if not provided
|
||||||
export DB_TYPE=${DB_TYPE:-sqlite}
|
export DB_TYPE=${DB_TYPE:-sqlite}
|
||||||
@@ -49,4 +50,4 @@ echo " - Flask Port: $FLASK_PORT"
|
|||||||
echo " - Debug Mode: $FLASK_DEBUG"
|
echo " - Debug Mode: $FLASK_DEBUG"
|
||||||
|
|
||||||
# Execute the command
|
# Execute the command
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user