wordpress / app.py
CatPtain's picture
Upload 5 files
5d4c685 verified
raw
history blame
1.2 kB
#!/usr/bin/env python3
"""
Hugging Face Space entry point for WordPress with SQLite
This file is required by Hugging Face Spaces to properly start the Docker container.
"""
import os
import subprocess
import time
import sys
def main():
"""
Main entry point for the Hugging Face Space
This will start the WordPress container and keep it running
"""
print("πŸš€ Starting WordPress with SQLite for Hugging Face Space...")
# Check if we're running in a Docker container
if os.path.exists('/.dockerenv'):
print("βœ… Running inside Docker container")
# If we're in Docker, the container should already be set up
# Just keep the process alive
try:
while True:
time.sleep(60)
# Optional: Add health check here
print("πŸ’“ WordPress container is running...")
except KeyboardInterrupt:
print("\nπŸ›‘ Shutting down WordPress...")
sys.exit(0)
else:
print("❌ This should run inside a Docker container")
print("Please deploy this to Hugging Face Spaces with Docker SDK")
sys.exit(1)
if __name__ == "__main__":
main()