This commit is contained in:
parent
d669251515
commit
087a343ebc
5 changed files with 19 additions and 15 deletions
16
CONTAINER.md
16
CONTAINER.md
|
@ -3,15 +3,13 @@
|
|||
Use `podman` or `docker`:
|
||||
|
||||
```sh
|
||||
podman run tiptop:5000/sms_handler
|
||||
podman run registry.philo.ydns.eu/philo/sms_handler
|
||||
```
|
||||
|
||||
**Note**: the container is not published publicly yet!
|
||||
|
||||
Pass parameters like this:
|
||||
Parameters are given as environment variables, eg.:
|
||||
|
||||
```sh
|
||||
podman run -e SMS_HANDLER_MAIL_SERVER_PORT=8025 -e SMS_HANDLER_MAIL_SENDER=snoopy@peanuts.com SMS_HANDLER_MAIL_TO=snoopy@peanuts.com tiptop:5000/sms_handler
|
||||
podman run -e SMS_HANDLER_MAIL_SERVER_PORT=8025 -e SMS_HANDLER_MAIL_SENDER=snoopy@peanuts.com SMS_HANDLER_MAIL_TO=snoopy@peanuts.com registry.philo.ydns.eu/philo/sms_handler
|
||||
```
|
||||
|
||||
## Container as a systemd service
|
||||
|
@ -20,14 +18,15 @@ Systemd can "orchestrate" containers easily thanks to podman.
|
|||
|
||||
### Rootless (as regular user)
|
||||
|
||||
For a rootless container, create a file in `.config/containers/systemd/sms-handler.container`:
|
||||
For a rootless container, create a file in `.config/containers/systemd/sms-handler.container`.
|
||||
The configuration is given as environment variables (email addresses `snoopy@peanuts.com` in this example):
|
||||
|
||||
```systemd
|
||||
[Container]
|
||||
ContainerName=sms-handler
|
||||
Environment=SMS_HANDLER_MAIL_SENDER=snoopy@peanuts.com
|
||||
Environment=SMS_HANDLER_MAIL_TO=snoopy@peanuts.com
|
||||
Image=tiptop:5000/sms_handler
|
||||
Image=registry.philo.ydns.eu/philo/sms_handler
|
||||
Network=podman
|
||||
PublishPort=8025:8025
|
||||
|
||||
|
@ -65,7 +64,7 @@ For a rootless container, create a file in `/etc/containers/systemd/sms-handler.
|
|||
ContainerName=sms-handler
|
||||
Environment=SMS_HANDLER_MAIL_SENDER=snoopy@peanuts.com
|
||||
Environment=SMS_HANDLER_MAIL_TO=snoopy@peanuts.com
|
||||
Image=tiptop:5000/sms_handler
|
||||
Image=registry.philo.ydns.eu/philo/sms_handler
|
||||
Network=podman
|
||||
PublishPort=8025:8025
|
||||
|
||||
|
@ -87,4 +86,3 @@ Start the container as a service:
|
|||
```sh
|
||||
sudo systemctl start sms-handler.service
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue