diff --git a/.dockerignore b/.dockerignore index 2897fda..260abeb 100644 --- a/.dockerignore +++ b/.dockerignore @@ -8,7 +8,7 @@ Dockerfile build/ **/__pycache__/ -**/*.md +*.md **/*.pyc **/*.pyo **/*.mo diff --git a/Dockerfile b/Dockerfile index 3e82182..9883869 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,9 +21,15 @@ RUN mkdir -p "${ENV_GHOSTFORGE_DATA_DIR}" WORKDIR /ghostforge COPY . . +# Install cffi dependencies for pip install. +RUN apk add --update --no-cache --virtual ghostforge_build libffi-dev musl-dev gcc + # Install ghostforge from the work directory. RUN pip install . +# Remove cffi dependencies for space. +RUN apk del ghostforge_build + # Expose the web "serve" port specific in the environment variables. ARG GHOSTFORGE_INTERNAL_WEB_PORT ENV ENV_GHOSTFORGE_INTERNAL_WEB_PORT=${GHOSTFORGE_INTERNAL_WEB_PORT} diff --git a/ghostforge/serve.py b/ghostforge/serve.py index 8f71f19..57b767a 100644 --- a/ghostforge/serve.py +++ b/ghostforge/serve.py @@ -69,7 +69,7 @@ async def get_faker(): @gf.get("/", response_class=HTMLResponse) -async def home(request: Request, current_user=Depends(get_current_user())): +async def home(request: Request, current_user=Depends(get_current_user(optional=True))): if current_user: return RedirectResponse(url="/dashboard") return RedirectResponse(url="/login") diff --git a/ghostforge/templates/dashboard.html b/ghostforge/templates/dashboard.html index 1d83317..677b284 100644 --- a/ghostforge/templates/dashboard.html +++ b/ghostforge/templates/dashboard.html @@ -10,7 +10,7 @@