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