Seafile server is not working in podman pod

Hello. I am trying to make seafile server work in podman pod but so far I didn’t success.

Blockquote
podman pod create --name seafile_pod -p 80:80 -p 443:443 -p

podman run -d --name seafile-db --pod seafile_pod
-e MYSQL_ROOT_PASSWORD=rootpass
-e MYSQL_DATABASE=seafile
-e MYSQL_USER=seafile
-e MYSQL_PASSWORD=secretpass
-v /home/ahmed/Desktop/podman_data/sea-file/seafile-db-data:/var/lib/mysql:z \ docker.io/mariadb:latest

podman run -d --name seafile-web
–pod seafile_pod
-e DB_HOST=127.0.0.1
-e DB_ROOT_PASSWD=rootpass
-v /home/ahmed/Desktop/podman_data/sea-file/seafile-data:/shared:z
seafileltd/seafile-pro-mc:12.0-latest

Note: I know that Caddy is also needed for HTTPS but I am trying it locally for the time been.

Please advise me as I am out of options.

So far I managed to fix the issues in the podman.

podman pod create --name seafile_pod -p 80:80 -p 443:443

podman run -d --name seafile-db --pod seafile_pod
-e MYSQL_ROOT_PASSWORD=rootpass
-e MYSQL_DATABASE=seafile
-e MYSQL_USER=seafile
-e MYSQL_PASSWORD=secretpass
-v /home/ahmed/Desktop/podman_data/sea-file/seafile-db-data:/var/lib/mysql:z
docker.io/mariadb:latest

podman run -d --name seafile-web --pod seafile_pod
-e DB_HOST=seafile-db
-e DB_ROOT_PASSWD=rootpass
-v /home/ahmed/Desktop/podman_data/sea-file/seafile-data:/shared:z
docker.io/seafileltd/seafile-pro-mc:12.0-latest

But still I have permission issues on the seafile container.

open() “/etc/nginx/sites-enabled/seafile.nginx.conf” failed (13: Permission denied) in /etc/nginx/nginx.conf:26

I provided a (z) for the SELINUX permissions but it is still giving the same error.

Please advise me and thank you.

I did some changes to the seafile image and the podman code is now

podman pod create --name seafile_pod -p 80:80 -p 443:443

podman run -d --name seafile-db --pod seafile_pod
-e MYSQL_ROOT_PASSWORD=rootpass
-e MYSQL_DATABASE=seafile
-e MYSQL_USER=seafile
-e MYSQL_PASSWORD=secretpass
-v /home/ahmed/Desktop/podman_data/sea-file/seafile-db-data:/var/lib/mysql:z
docker.io/mariadb:latest

podman run -d --name seafile-web --pod seafile_pod
-e DB_HOST=seafile-db
-e DB_ROOT_PASSWD=rootpass
-v /home/ahmed/Desktop/podman_data/sea-file/seafile-data:/shared:z
docker.io/seafileltd/seafile-mc:12.0-latest

But the error is now

Cannot find JWT_PRIVATE_KEY value from environment, try to read .env file.
Error: .env file not found.
Please follow the upgrade manual to set the .env file.

Traceback (most recent call last):
File “/scripts/start.py”, line 94, in
main()
File “/scripts/start.py”, line 79, in main
call(‘{} start’.format(get_script(‘seafile.sh’)))
File “/scripts/utils.py”, line 70, in call
return subprocess.check_call(*a, **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.12/subprocess.py”, line 413, in check_call
raise CalledProcessError(retcode, cmd)
�subprocess.CalledProcessError: Command ‘/opt/seafile/seafile-server-12.0.9/seafile.sh start’ returned non-zero exit status 255.

Please advise me And thank you.

FYI I run with rootless podman inside a systemd service. Using actually podlet. Posting some notes I have. Although had to do some tinkering with nginx configuration because using another reverse proxy. There was another thread about using a separate reverse proxy with TLS where I say what options I changed. This is for version 11, not yet upgraded to 12.

/etc/containers/systemd/users/1005/mariadb.container:
[Unit]
Description=MariaDB

[Container]
Image=docker.io/library/mariadb:11-ubi9
ContainerName=mariadb
Environment=MARIADB_RANDOM_ROOT_PASSWORD=1
AutoUpdate=registry
PublishPort=3306:3306
Volume=/media/whatever/mariadb/data:/var/lib/mysql:Z
Volume=/media/whaterver/mariadb/conf.d:/etc/mysql/conf.d:Z
Network=seafile

[Install]
WantedBy=multi-user.target default.target

[Service]
TimeoutStartSec=900
Restart=always

as_the_container_user: systemctl --user daemon-reload


# Seafile installation
# https://manual.seafile.com/docker/deploy_seafile_with_docker
as_the_container_user: mkdir /media/somemount/containers_services_data/seafile
as_the_container_user: chmod 755 /media/somemount/containers_services_data/seafile
as_the_container_user: chcon system_u:object_r:container_file_t:s0:c440,c512 /media/somemount/containers_services_data/seafile
as_the_container_user: podlet compose seafile-compose.yml # edit result

; /etc/containers/systemd/users/1005/seafile-memcached.container
[Container]
ContainerName=seafile-memcached
Exec=-m 256
Network=seafile
NetworkAlias=memcached
Image=docker.io/library/memcached:1.6.18

[Service]
TimeoutStartSec=900
Restart=always

; /etc/containers/systemd/users/1005/seafile.container
[Unit]
Requires=mariadb.service seafile-memcached.service
After=mariadb.service seafile-memcached.service

[Container]
ContainerName=seafile
Environment=HTTPS_INSECURE=true DB_HOST=mariadb DB_ROOT_PASSWD=DELETE_ME TIME_ZONE=Etc/UTC SEAFILE_ADMIN_EMAIL=my-cool-email-address@duck.com SEAFILE_ADMIN_PASSWORD=DELETE_ME SEAFILE_SERVER_LETSENCRYPT=false SEAFILE_SERVER_HOSTNAME=seafile.mydomainname.com
Image=docker.io/seafileltd/seafile-mc:11.0-latest
Network=seafile,podman
#AddHost=acme-v02.api.letsencrypt.org:172.65.46.172 # option not supported yet, ip of acme staging server
PodmanArgs=--add-host acme-v02.api.letsencrypt.org:172.65.46.172
AutoUpdate=registry
StopTimeout=900
PublishPort=8101:80
SecurityLabelLevel=s0:c440,c512
Volume=/media/somemount/containers_services_data/seafile:/shared

[Install]
WantedBy=multi-user.target default.target

[Service]
TimeoutStartSec=900
TimeoutStopSec=950
Restart=always
ExecStartPre=rm -r /media/somemount/containers_services_data/seafile/seafile/conf/__pycache__/

I am running seafile from command line rootless via:

podman pod create --name=seafile-pod  --publish=8083:80 &&   \
podman run -d --pod seafile-pod --name mariadb   \
   -v /cache/databases/seafile:/var/lib/mysql:rw,Z \
   --env-file /srv/seafile/seafile-container/sql.env   \
   docker.io/library/mariadb:10 &&  \
podman run -d --pod seafile-pod     docker.io/library/memcached:1.6 -m 256 && \
podman run -d --pod seafile-pod --name seafile  \
  -v /srv/seafile/seafile-shared/:/shared:Z  \
  -v /srv/seafile/seafile-data:/shared/seafile/seafile-data:Z  \
  --env-file /srv/seafile/seafile-container/seafile.env  \
  docker.io/seafileltd/seafile-mc:11.0-latest