How to install apps with Docker on Yunohost (how I did it)

The contener is running :

CONTAINER ID   IMAGE                         COMMAND                 CREATED             STATUS             PORTS                                                                                                                                 NAMES
6a78af065423   allebb/studio-server:latest   "/bin/sh -c /boot.sh"   About an hour ago   Up About an hour   0.0.0.0:8543->8543/tcp, :::8543->8543/tcp, 0.0.0.0:50059->50059/tcp, :::50059->50059/tcp, 0.0.0.0:5433->5432/tcp, :::5433->5432/tcp   studio-server

I check the log, there is one error, but seems not to be too much a problem :s

2024-02-16 12:43:30.534 GMT [413] ERROR:  duplicate key value violates unique constraint "cache_pkey"
2024-02-16 12:43:30.534 GMT [413] DETAIL:  Key (key)=(studio_server_web_cache_logo) already exists.
2024-02-16 12:43:30.534 GMT [413] STATEMENT:  insert into "cache" ("key", "value", "expiration") values ($1, $2, $3)

I am not knowledgable enough, unfortunately, but I suppose this has more to do with the application than with Docker or Yunohost, so maybe you could consult the support of the application?

I just sent an email, i will see for that.

Thanks for you time :slight_smile:

I found out an opensource project, maybe i should try this one :

I really have the impression that it’s yunohost which (for good reasons) refuses to let the client software reach the server. I tried opening the ports (and closing them) but it didn’t work.

I tried on another computer on a blank debian, everything worked fine in local ip.

Edit, i’ve got this error on resolve when i try to connect on local ip

From what I understand, here the local IP for the psql server is the IP of your server.
And you opened port 5433 for the postgresql docker.

You have 2 ways to connect to postgresql from one docker to another :

  • If you used a docker-compose.yml, you’ll be able to connect using the local docker DNS, directly on the internal port.
  • If not, by using the server IP, you must use port 5433

I suggest to use a docker-compose.yml, that way all dockers will be linked, you’ll have a sort of local network for all the images in the same docker-compose.yml, and no need to remember the starting command. (But you do not have to, it’s just a suggestion, you can run them perfectly without this)

1 Like

Thanks a lot for sharing! I’ll try to adapt this in a few days for zigbee2mqtt (I’d love to help with the ynh package, but currently only have a productive system). Do you have a special backup strategy for your approach?

I see in the example you use the volume scheme /home/my-app/my-volume, so probably you’d only need to back up this one. I wonder what works nicely with the docker approach. I could integrate additional files/hooks with the current method like described in the wiki. But as I may want to change to other methods anyway, I wonder what you use.

Idea drop: We do have this approach with .nobackup files. I think, we could also have a cron script creating hooks for all folders in /home with a docker-compose.yml or a .folderbackup file, after shutting down the container.

I managed to make it work by making a NAT rules postrooting port 3432 to the docker.

Thats very cool now.