selfoss icon indicating copy to clipboard operation
selfoss copied to clipboard

Docker

Open squatica opened this issue 4 years ago • 14 comments

Hi, building on top of the PR #1162 updated the branches with current master and joined mine and @akash07k 's changes together into this PR. I suggest to squash all the commits together (maybe except deasync and '--dev'), because it's pretty confusing as it is. I left them separate for now just in case you prefer to look at all the single commits.

squatica avatar Feb 07 '20 06:02 squatica

@jtojnar What do you think? Can it be merged? Or anything else necessary?

squatica avatar Feb 14 '20 12:02 squatica

OK, I tested how it works with docker-compose files in utils/docker and it seems to be fine. It's not standard but works.

About Apache - I'd rather keep it, because there are a bunch of .htaccess files which will all stop working under php builtin server. Also php builtin server should not be used for production. What do you find complex about the Dockerfiles? They seem quite small to me, I've seen much worse :-D The production one is split into three parts using multi-staged build because we don't need npm nor composer for the production runtime environment. And the dev dockerfile basically only installs node and composer according to their official installation instructions. One minor simplification will become possible once the config.ini location is configurable or moved into data directory as suggested by #913 .

squatica avatar Feb 16 '20 13:02 squatica

Thanks a lot @squatica for this. It's working great so far. Actually I was out of station so couldn't pay attention to it till now. Thanks a tons for your efforts into this!

akash07k avatar Feb 16 '20 15:02 akash07k

Hey @akash07k nice to hear from you again, I was worried what happened to you :smiley:

@jtojnar I created a docker hub account for selfoss, I'm going to configure automatic builds of the production image. Let me know how I can transfer the ownership to you.

squatica avatar Feb 17 '20 06:02 squatica

@squatica Yes buddy. actually I went on vacations for sometime and my laptop wasn't with me. I'm back now. how are you? and I'm very greatful for you for your efforts. I pinged you on gitter a month back but probably you were busy then.

Hey @akash07k nice to hear from you again, I was worried what happened to you 😃

@jtojnar I created a docker hub account for selfoss, I'm going to configure automatic builds of the production image. Let me know how I can transfer the ownership to you.

akash07k avatar Feb 17 '20 12:02 akash07k

Isn't it yet ready for merge?

akash07k avatar Mar 10 '20 17:03 akash07k

The main blocker is that we do not have anyone knowledgable in Docker to properly review this.

jtojnar avatar Mar 28 '20 19:03 jtojnar

:(

On 3/29/20, Jan Tojnar [email protected] wrote:

The main blocker is that we do not have anyone knowledgable in Docker to properly review this.

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/SSilence/selfoss/pull/1170#issuecomment-605505092

akash07k avatar Mar 29 '20 04:03 akash07k

Looks quite good, I have a few ideas:

  1. I would suggest creating the dev image on top of the production image - that way you get the benefit of having the same docker image for dev and prod (well, almost at least).
  2. Another approach would be to have a seperate "workspace" container which contains all the tools needed for development (composer etc) and has the same mounts as the prod image. Both would run side by side, but the prod image based container would only host the files - and be the same as any "real" prod deployment. This one would then also do things like running the frontend watcher on startup.

kolaente avatar Apr 07 '20 20:04 kolaente

Looks quite good, I have a few ideas:

  1. I would suggest creating the dev image on top of the production image - that way you get the benefit of having the same docker image for dev and prod (well, almost at least).
  2. Another approach would be to have a seperate "workspace" container which contains all the tools needed for development (composer etc) and has the same mounts as the prod image. Both would run side by side, but the prod image based container would only host the files - and be the same as any "real" prod deployment. This one would then also do things like running the frontend watcher on startup. Good ideas, I'm not that expert in Docker otherwise I would have tried working on these. @squatica opinions bro?

akash07k avatar May 01 '20 16:05 akash07k

It seems that now there are some package conflicts in package.lock.json due to the dependency updates. :-)

akash07k avatar May 01 '20 16:05 akash07k

Hello, An official container image would be really nice (and I may even build a Helm Chart for Kubernetes on top of this). Could we help in anything in order to have this merged and the image automatically built/published somewhere?

desaintmartin avatar Oct 10 '21 19:10 desaintmartin

Sorry, I do not really use docker so it has been difficult for me to allocate time to it. I will try to do something with #1271 this week.

jtojnar avatar Oct 11 '21 16:10 jtojnar

If you need some help with it, I'm running https://github.com/armandabric/docker-selfoss since few year now. I hope it could help

armandabric avatar Oct 13 '21 12:10 armandabric