mirror of
https://github.com/booklore-app/booklore.git
synced 2026-02-18 00:17:53 +01:00
docs: added example for rootless podman quadlet deployment (#1389)
This commit is contained in:
35
example-podman/README.md
Normal file
35
example-podman/README.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# Podman Example
|
||||
This directory contains an example of how to use a rootless Podman pod defined through Quadlets to run booklore.
|
||||
|
||||
# Setup
|
||||
1. Copy the files in this directory to a suitable location on your system.
|
||||
- For many systems Quadlet monitors `~/.config/containers/systemd`
|
||||
- `mkdir -p ~/.config/containers/systemd && cp ./*lore* ~/.config/containers/systemd/`
|
||||
2. Edit the `booklore.container` to set the correct mounts for `bookdrop` and your library
|
||||
3. Create the Podman Secrets for the database
|
||||
```bash
|
||||
echo -n "YOUR PASSWORD" | podman secret create booklore_db_pass -
|
||||
```
|
||||
4. (Optional) `podman pull ghcr.io/booklore-app/booklore:latest` to pre-pull the image
|
||||
* If you have a slow connection, this is recommended because systemd will time out if the image pull takes too long.
|
||||
5. Run `systemctl --user daemon-reload` to pick up the new Quadlet unit.
|
||||
6. Start the pod with `systemctl --user start booklore-pod.service`
|
||||
|
||||
# Autoupdates
|
||||
If automatic updates are desired, enable the systemd timer:
|
||||
```bash
|
||||
systemctl --user enable podman-auto-update.timer
|
||||
```
|
||||
|
||||
This is a native way to schedule `podman auto-update` to run periodically and update/restart containers with `AutoUpdate` enabled in their Quadlet files.
|
||||
|
||||
# Verification Commands
|
||||
- `systemctl --user status booklore-pod -l` - Check the status of the pod
|
||||
- `systemctl --user status booklore-db -l` - Check the status of the database
|
||||
- `systemctl --user status booklore -l` - Check the status of the booklore container
|
||||
|
||||
|
||||
# Further Reading
|
||||
- [Podman Quadlets Documentation](https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html)
|
||||
- [Bazzite Podamn Quadlet Examples](https://docs.bazzite.gg/Installing_and_Managing_Software/Quadlet/)
|
||||
- `man podman-systemd.unit`
|
||||
2
example-podman/booklore-data.volume
Normal file
2
example-podman/booklore-data.volume
Normal file
@@ -0,0 +1,2 @@
|
||||
[Volume]
|
||||
VolumeName=booklore-data
|
||||
21
example-podman/booklore-db.container
Normal file
21
example-podman/booklore-db.container
Normal file
@@ -0,0 +1,21 @@
|
||||
[Unit]
|
||||
Description=BookLore Database Container Using MariaDB
|
||||
|
||||
[Container]
|
||||
ContainerName=booklore-db
|
||||
Image=lscr.io/linuxserver/mariadb:11.4.5
|
||||
Pod=booklore.pod
|
||||
Pull=always
|
||||
|
||||
Volume=booklore-db:/config
|
||||
|
||||
Environment=TZ=Etc/UTC
|
||||
Environment=PUID=0
|
||||
Environment=PGID=0
|
||||
Environment=MYSQL_USER=booklore
|
||||
Secret=booklore_db_pass,type=env,target=MYSQL_ROOT_PASSWORD
|
||||
Secret=booklore_db_pass,type=env,target=MYSQL_PASSWORD
|
||||
Environment=MYSQL_DATABASE=booklore
|
||||
|
||||
DropCapability=all
|
||||
AddCapability=CAP_CHOWN CAP_SETUID CAP_SETGID CAP_FOWNER
|
||||
2
example-podman/booklore-db.volume
Normal file
2
example-podman/booklore-db.volume
Normal file
@@ -0,0 +1,2 @@
|
||||
[Volume]
|
||||
VolumeName=booklore-db
|
||||
23
example-podman/booklore.container
Normal file
23
example-podman/booklore.container
Normal file
@@ -0,0 +1,23 @@
|
||||
[Unit]
|
||||
Description=booklore container
|
||||
Requires=booklore-db.container
|
||||
After=booklore-db.container
|
||||
|
||||
[Container]
|
||||
ContainerName=booklore
|
||||
Image=ghcr.io/booklore-app/booklore:latest
|
||||
Pod=booklore.pod
|
||||
AutoUpdate=registry
|
||||
Pull=always
|
||||
|
||||
Volume=booklore-data:/app/data
|
||||
# note the :z is important for selinux systems
|
||||
# Volume=YOUR MOUNTS:/books:z
|
||||
# Volume=YOUR MOUNTS:/bookdrop:z
|
||||
|
||||
|
||||
Environment=TZ=Etc/UTC
|
||||
Secret=booklore_db_pass,type=env,target=DATABASE_PASSWORD
|
||||
Environment=DATABASE_URL=jdbc:mariadb://localhost:3306/booklore
|
||||
Environment=DATABASE_USERNAME=booklore
|
||||
Environment=BOOKLORE_PORT=6060
|
||||
7
example-podman/booklore.pod
Normal file
7
example-podman/booklore.pod
Normal file
@@ -0,0 +1,7 @@
|
||||
[Unit]
|
||||
Description=BookLore Pod
|
||||
After=network-online.target
|
||||
|
||||
[Pod]
|
||||
PodName=booklore
|
||||
PublishPort=6060:6060
|
||||
Reference in New Issue
Block a user