mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-10-31 10:13:32 -04:00 
			
		
		
		
	Mount Vue Frontend only in production
This commit is contained in:
		| @@ -21,4 +21,6 @@ COPY ./mealie /app | |||||||
| COPY ./mealie/data/templates/recipes.md /app/data/templates/ | COPY ./mealie/data/templates/recipes.md /app/data/templates/ | ||||||
| COPY --from=build-stage /app/dist /app/dist | COPY --from=build-stage /app/dist /app/dist | ||||||
|  |  | ||||||
|  | ENV ENV prod | ||||||
|  |  | ||||||
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "9000"] | CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "9000"] | ||||||
| @@ -1,4 +1,5 @@ | |||||||
| from pathlib import Path | from pathlib import Path | ||||||
|  | import os | ||||||
|  |  | ||||||
| import uvicorn | import uvicorn | ||||||
| from fastapi import FastAPI | from fastapi import FastAPI | ||||||
| @@ -24,8 +25,10 @@ WEB_PATH = CWD.joinpath("dist") | |||||||
| app = FastAPI() | app = FastAPI() | ||||||
|  |  | ||||||
|  |  | ||||||
| # Mount Vue Frontend | # Mount Vue Frontend only in production | ||||||
| app.mount("/static", StaticFiles(directory=WEB_PATH, html=True)) | env = os.environ.get("ENV") | ||||||
|  | if(env == "prod"): | ||||||
|  |     app.mount("/static", StaticFiles(directory=WEB_PATH, html=True)) | ||||||
|  |  | ||||||
| # API Routes | # API Routes | ||||||
| app.include_router(recipe_routes.router) | app.include_router(recipe_routes.router) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user