Run container with uvicorn, move templates for packaging, add systemd config for container deployment, add OIDC_TEST_SETTINGS_FILE env var for setting, misc fixes

This commit is contained in:
phil 2025-01-10 17:33:10 +01:00
parent 170e663ee8
commit 57681d91fe
12 changed files with 146 additions and 49 deletions

View file

@ -7,8 +7,18 @@ COPY . /src
# Sync the project into a new environment, using the frozen lockfile
WORKDIR /src
RUN uv sync --frozen --no-cache && uv pip install --system .
RUN uv pip install --system .
#ENV PATH="/src/.venv/bin:$PATH"
CMD ["oidc-test", "--port", "80"]
# Possible to run with:
#CMD ["oidc-test", "--port", "80"]
#CMD ["fastapi", "run", "src/oidc_test/main.py", "--port", "8873", "--root-path", "/oidc-test"]
#
# Running uvicorn is most flexible:
CMD [ \
"uvicorn", \
"oidc_test.main:app", \
"--host", "0.0.0.0", \
"--port", "80", \
"--forwarded-allow-ips", "*", \
"--root-path", "/oidc-test" \
]