Add Quadlet Container File (#319)

* Add Quadlet Container File

* Update README.md with Quadlet instructions
This commit is contained in:
James Musselman 2024-11-19 12:19:48 -06:00 committed by GitHub
parent 96ebfd2d3a
commit 0bc36d529c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 51 additions and 1 deletions

View File

@ -35,6 +35,9 @@
- [Docker](#docker) - [Docker](#docker)
- [Docker Compose](#docker-compose) - [Docker Compose](#docker-compose)
- [Docker CLI](#docker-cli) - [Docker CLI](#docker-cli)
- Podman
- Quadlets
- [Binary](#binary) - [Binary](#binary)
- [Running as a systemd service](#running-as-a-systemd-service) - [Running as a systemd service](#running-as-a-systemd-service)
- [Building from source](#building-from-source) - [Building from source](#building-from-source)
@ -180,7 +183,7 @@ For configuration options, see the [Configuration section](#Configuration).
[Docker](https://www.docker.com) lets you run containerized applications. Containers are loosely isolated environments that are lightweight and contain everything needed to run the application, so there's no need to rely on what's installed on the host. [Docker](https://www.docker.com) lets you run containerized applications. Containers are loosely isolated environments that are lightweight and contain everything needed to run the application, so there's no need to rely on what's installed on the host.
Docker images for Redlib are available at [quay.io](https://quay.io/repository/redlib/redlib), with support for `amd64`, `arm64`, and `armv7` platforms. Container images for Redlib are available at [quay.io](https://quay.io/repository/redlib/redlib), with support for `amd64`, `arm64`, and `armv7` platforms.
### Docker Compose ### Docker Compose
@ -224,6 +227,37 @@ Stream logs from the Redlib container:
```bash ```bash
docker logs -f redlib docker logs -f redlib
``` ```
## Podman
[Podman](https://podman.io/) lets you run containerized applications in a rootless fashion. Containers are loosely isolated environments that are lightweight and contain everything needed to run the application, so there's no need to rely on what's installed on the host.
Container images for Redlib are available at [quay.io](https://quay.io/repository/redlib/redlib), with support for `amd64`, `arm64`, and `armv7` platforms.
### Quadlets
> [!IMPORTANT]
> These instructions assume that you are on a systemd based distro with [podman](https://podman.io/). If not, follow these [instructions on podman's website](https://podman.io/docs/installation) for how to do so.
> It also assumes you have used `loginctl enable-linger <username>` to enable the service to start for your user without logging in.
Copy the `redlib.container` and `.env.example` files to `.config/containers/systemd/` and modify any relevant values (for example, the ports Redlib should listen on, renaming the .env file and editing its values, etc.).
To start Redlib either reboot or follow the instructions below:
Notify systemd of the new files
```bash
systemctl --user daemon-reload
```
Start the newly generated service file
```bash
systemctl --user start redlib.service
```
You can check the status of your container by using the following command:
```bash
systemctl --user status redlib.service
```
## Binary ## Binary

16
redlib.container Normal file
View File

@ -0,0 +1,16 @@
[Install]
WantedBy=default.target
[Container]
AutoUpdate=registry
ContainerName=redlib
DropCapability=ALL
EnvironmentFile=.env
HealthCmd=["wget","--spider","-q","--tries=1","http://localhost:8080/settings"]
HealthInterval=5m
HealthTimeout=3s
Image=quay.io/redlib/redlib:latest
NoNewPrivileges=true
PublishPort=8080:8080
ReadOnly=true
User=nobody