Multiple seafile with docker

docker
server

#1

Hi,
I use docker.
I have a server with one container “Seafile” that works perfectly.
I want to add another container “Seafile2” on the same server.
To run the first seafile server container i proceeded like that :
docker run -d --name seafile
-e SEAFILE_SERVER_LETSENCRYPT=true
-e SEAFILE_SERVER_HOSTNAME=*********
-e SEAFILE_ADMIN_EMAIL=*************
-e SEAFILE_ADMIN_PASSWORD=asecret
-v /mnt/disk/seafile-data:/shared
-p 80:80
-p 443:443 \

And for second container i proceed like that :
docker run -d --name seafile2
-e SEAFILE_SERVER_HOSTNAME=*************
-e SEAFILE_ADMIN_EMAIL=************
-e SEAFILE_ADMIN_PASSWORD=asecret2
-v /mnt/disk2/seafile-data:/shared
-p 8090:80
-p 44443:443 \

I can access to my first container over https.
I can access to my second container over http(port) but i can’t access over https.
I can’t use let’s encrypt for the second container, what i’m supposed to do?

Thank you,


#2

Hi,

Well you can use Apache or Nginx as a reverse proxy in front of your Seafile Docker containers. Then Only your proxy (Nginx or Apache) will require Lets Encrypt SSL, and your docker containers can work over HTTP.


#3

Hi,
I am trying to modify the nginx configuration file inside the container. (seafile.nginx.conf).

That’s what my configuration file looks like:
server {
listen 80;
server_name seafile.example.com;
rewrite ^ https: // $ http_host $ request_uri? permanent;
server_tokens off;
}
server {
listen 443;
ssl on;
ssl_certificate /mnt/disk2/seafile-data/ssl/domain.crt; # path to your cacert.pem
ssl_certificate_key /mnt/disk2/seafile-data/ssl/domain.crt; # path to your privkey.pem
server_name seafile.example.com;
server_tokens off;
# …
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $ host;
proxy_set_header X-Real-IP $ remote_addr;
proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $ server_name;
proxy_set_header X-Forwarded-Proto https;

proxy_read_timeout 1200s;

}

But when I restart nginx with docker: docker exec seafile2 nginx -s reload I have the following error:
"nginx: [emerg] Bio_new_file (“my_domain.crt) failed (error: SSL: error: 02001002 system_library: fopen.) error: 2006D080: BIO routines: BIO_new_file: no such file. )”

I tried to modify the access rights to my key but it still does not work.

Can you help me please?