Fixing error on device
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
# Set maintainer
|
||||
LABEL maintainer="your-email@example.com"
|
||||
LABEL maintainer="fuh@fuhlig.de"
|
||||
LABEL description="PY_ChatBot - Modern Flask-based Chatbot Application"
|
||||
|
||||
# Set environment variables
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
services:
|
||||
# Main ChatBot Application
|
||||
chatbot:
|
||||
build:
|
||||
context: .
|
||||
@@ -36,22 +35,34 @@ services:
|
||||
retries: 3
|
||||
start_period: 30s
|
||||
|
||||
# Optional: PostgreSQL Database (for production)
|
||||
#postgres:
|
||||
# image: postgres:15-alpine
|
||||
# container_name: py_chatbot_postgres
|
||||
# restart: unless-stopped
|
||||
# environment:
|
||||
# - POSTGRES_DB=chatbot
|
||||
# - POSTGRES_USER=chatbot_user
|
||||
# - POSTGRES_PASSWORD=secure_password_change_this
|
||||
# volumes:
|
||||
# - postgres_data:/var/lib/postgresql/data
|
||||
# - ./init.sql:/docker-entrypoint-initdb.d/init.sql:ro
|
||||
# networks:
|
||||
# - chatbot_network
|
||||
# profiles:
|
||||
# - postgres
|
||||
postgres:
|
||||
image: postgres:15-alpine
|
||||
container_name: py_chatbot_postgres
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- POSTGRES_DB=chatbot
|
||||
- POSTGRES_USER=chatbot_user
|
||||
- POSTGRES_PASSWORD=secure_password_change_this
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
- ./init.sql:/docker-entrypoint-initdb.d/init.sql:ro
|
||||
networks:
|
||||
- chatbot_network
|
||||
profiles:
|
||||
- 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
|
||||
volumes:
|
||||
@@ -59,8 +70,10 @@ volumes:
|
||||
driver: local
|
||||
chatbot_logs:
|
||||
driver: local
|
||||
#postgres_data:
|
||||
# driver: local
|
||||
postgres_data:
|
||||
driver: local
|
||||
redis_data:
|
||||
driver: local
|
||||
|
||||
# Networks
|
||||
networks:
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
set -e
|
||||
|
||||
echo "🤖 Starting PY_ChatBot..."
|
||||
# Create directory for database dynamically based on SQLITE_PATH
|
||||
|
||||
# Create directories if they don't exist
|
||||
mkdir -p /app/databases /app/logs
|
||||
DB_DIR=$(dirname "$SQLITE_PATH")
|
||||
mkdir -p "$DB_DIR" /app/logs
|
||||
|
||||
# Set default environment variables if not provided
|
||||
export DB_TYPE=${DB_TYPE:-sqlite}
|
||||
|
||||
Reference in New Issue
Block a user