instrucciones

This commit is contained in:
Your Name
2025-02-09 22:02:39 +01:00
parent b4b2d899aa
commit 5a0833f3cf
2 changed files with 30 additions and 1 deletions

30
README.md Normal file
View File

@ -0,0 +1,30 @@
# Instalación
Para instalar la aplicación descargar el proyecto. Una vez descargado, el archivo main.py debe quedar así comentado:
```python
from fastapi import FastAPI
from .database import Base, engine
from .routes import router
# from apscheduler.schedulers.background import BackgroundScheduler
# from .webscrapper import ejecutar_scrapper
# Crear las tablas en MySQL si no existen
Base.metadata.create_all(bind=engine)
# Inicializar FastAPI
app = FastAPI()
# scheduler = BackgroundScheduler()
# Incluir rutas
app.include_router(router)
# @app.on_event("startup")
# def startup_event():
# scheduler.add_job(ejecutar_scrapper, "interval", hours=24)
# scheduler.start()
# @app.on_event("shutdown")
# def shutdown_event():
# scheduler.shutdown()
```
Proceder con `docker-compose up -d --build`.
Una vez finalizado, descomentar las líneas y realizar de nuevo `docker-compose up -d --build`.