Well, I worked around it by replacing $user with joplin and now it works.
It's a bit of a mystery why it doesn't work for you. But let's see if other users come across this issue too.
Are there plans to publish an image on DockerHub
Most likely yes, although I'm clueless at this point how to do that. The server is built with docker-compose and it's not clear if it's possible to publish a docker-compose file to DockerHub.
It isn't, hub is for posting Docker images, not compose files. You would need to build the server into an image, then distribute the image through hub.
So it means you'd still have run the docker-compose file to run the server, is that correct? In that case, how do people distribute these docker-compose files? Just clone the whole repo? Or is there a better way to do this?
So, in most cases it's in the description or linked in the repo of the image.
That's what I did on Docker Hub for the florider89/joplin-server image.
It's a specific one for traefik at the moment, but I'll add a more general one to the README in the coming days - the more generic parts are currently just commented for that reason.
Thanks for the info, that makes sense. Eventually, I guess cloning the repo won't be necessary anymore if all that's needed is in the Docker image and docker-compose file.
Could you clarify what should be exposed? Currently the server, as defined in Dockerfile.server, will connect to the provided JOPLIN_PORT. Is there something more that should appear?
Compose files aren't usually directly shared verbatim. A lot of people don't even use compose, and Compose syntax varies between versions of compose itself. Popular images typically supply some Compose template information, mostly to help out folk new to Compose, but people well versed in Compose usually have their own templates that fit their environment.
If you want good examples, take a look at images from a popular Image provider like the linuxserver.io team.
Regarding DB's. Many folk using Docker prefer to run their own DB container, which can service multiple applications at once and avoid running multiple database instances. A lot of images simply contain the code necessary to set up their database after being supplied credentials. You might want to go that route as well and make it easier on yourself. For example look at the Nextcloud image, running on its own it will use a built-in SQLite database, great for testing out the image or a very small environment. But if you supply connection information to an external database, it will use that.
Not trying to criticize you at all here, I'm excited for Joplin Server, but there's a "Docker best practices" way of doing things, you're just unfamiliar with them right now. Take a look at lot of popular images for self-hosted servers on hub and see how they do things.
Well, the database here seems to be hard-coded with the provided credentials in the Dockerfile (or elsewhere, unsure right now) - basically, not changeable
I see this both as an inconvenience and, perhaps a security risk to some - if I wanted to run only a single container for all of my DB needs, this would make it harder.
Furthermore, the Docker build is failing for me on step 10 with the following error:
Step 10/31 : COPY --chown=$user:$user package*.json ./
COPY failed: no source files were specified
EDIT: I might know why, because the build is also dependant on the .env file. That would also be nice to fix - as I see it, a Docker image should be as barebones as possible, usable for everyone without them having to build their own image.
I will check how the sources actually work and see if I can help somehow
EDIT2: Nevermind, I don't think it's dependent... Not sure what might be causing it then
@laurent Not familiar with what? With the kind of "program" I suggested?
"You get me wrong. I mean, instead of Joplin Server as a docker image wouldn`t it make sense to build a joplin server with docker? E.g. to have it installed on a webspace. I think that would work as you only need the joplin server files, a config file and the database connected.
I hope this and my initial posting make it clearer what I`m looking for."
You don't need to use Docker. You can build the Joplin Server on any server - or machine for that matter - that runs node, so there's no need to build it using Docker or using Docker at all.
You don`t know what a webspace is? I mean not everybody is running / wants to run a server. With webspace I mean webhosting packages it Apache/nginx, PHP etc. where you can install applications"
instead of Joplin Server as a docker image wouldn`t it make sense to build a joplin server without docker
As mentioned by @florider you can indeed manually install the server if you want. For example you can follow the instructions in the Docker file and run them manually.