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:
parent
170e663ee8
commit
57681d91fe
12 changed files with 146 additions and 49 deletions
41
deployment/README.md
Normal file
41
deployment/README.md
Normal file
|
@ -0,0 +1,41 @@
|
|||
# Deployment / installation
|
||||
|
||||
This documentation covers the specifics of Oidc-fastapi-test deployment, but
|
||||
it does no cover application configuration details,
|
||||
the set up of a public facing web server handling dns domain / https security.
|
||||
|
||||
*Oidc-fastapi-test* is shipped as containers for easy and effective installation,
|
||||
and packages to deploy them for different environments.
|
||||
|
||||
There is 1 containers:
|
||||
|
||||
- oidc-fast-test (Python server)
|
||||
|
||||
Commands below assume that they are run from their respective directories
|
||||
(`deployment/systemd`, `deployment/kubernetes`, ...).
|
||||
|
||||
## Systemd
|
||||
|
||||
With the help of *podman*, systemd can handle starting/restarting services, etc,
|
||||
even with a non-privileged user.
|
||||
|
||||
The 1 container is in the same *pod*, as it is meant primarily for a lightweight
|
||||
production environment, but this can be easily adapted.
|
||||
|
||||
The `deployment/systemd` directory contains files used for running
|
||||
*Oidc-fastapi-test* with Systemd.
|
||||
Podman is used to facilitate the creation of the relevant services.
|
||||
|
||||
### Deployment
|
||||
|
||||
```sh
|
||||
cp -r * $HOME/.config/containers/systemd/
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user start oidc-fastapi-test-pod.service
|
||||
```
|
||||
|
||||
Note that starting on system boot requires the user to be enabled accordingly with:
|
||||
|
||||
```sh
|
||||
sudo loginctl enable-linger <username>
|
||||
```
|
11
deployment/systemd/oidc-fastapi-test.container
Normal file
11
deployment/systemd/oidc-fastapi-test.container
Normal file
|
@ -0,0 +1,11 @@
|
|||
[Container]
|
||||
ContainerName=oidc-fastapi-test
|
||||
Image=code.philo.ydns.eu/philorg/oidc-fastapi-test:latest
|
||||
Pod=oidc-fastapi-test.pod
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
|
3
deployment/systemd/oidc-fastapi-test.network
Normal file
3
deployment/systemd/oidc-fastapi-test.network
Normal file
|
@ -0,0 +1,3 @@
|
|||
[Network]
|
||||
NetworkName=oidc-fastapi-test
|
||||
Label=app=oidc-fastapi-test
|
11
deployment/systemd/oidc-fastapi-test.pod
Normal file
11
deployment/systemd/oidc-fastapi-test.pod
Normal file
|
@ -0,0 +1,11 @@
|
|||
[Pod]
|
||||
PodName=oidc-fastapi-test
|
||||
Network=oidc-fastapi-test.network
|
||||
PublishPort=8873:80
|
||||
|
||||
[Unit]
|
||||
After=podman-user-wait-network-online.service
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue