|
|
|
""" |
|
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...") |
|
|
|
|
|
if os.path.exists('/.dockerenv'): |
|
print("β
Running inside Docker container") |
|
|
|
|
|
try: |
|
while True: |
|
time.sleep(60) |
|
|
|
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() |