indiekit icon indicating copy to clipboard operation
indiekit copied to clipboard

Add Dockerfile

Open jlelse opened this issue 6 years ago • 5 comments

Add Dockerfile to easily build the project as Docker image.

(I will do this and create a PR.)

jlelse avatar Oct 28 '19 09:10 jlelse

Hi @jlelse, have you made any progress on this? I already use a Dockerfile locally and am happy to let the community iterate on it. 😊

MaybeThisIsRu avatar Aug 01 '20 06:08 MaybeThisIsRu

@hirusi Oh I'm sorry, in the end I didn't choose Indiekit but wrote my own micropub endpoint. So I also have no Dockerfile for Indiekit.

jlelse avatar Aug 01 '20 06:08 jlelse

For v0.0.x, a reference Dockerfile is available here. Let me be upfront in stating this is not supposed to be production-ready; works for me, your mileage may vary.

MaybeThisIsRu avatar Aug 24 '20 19:08 MaybeThisIsRu

Once v0.1.0 is published, I will be happy to contribute a starting point for a Dockerfile.

MaybeThisIsRu avatar Sep 01 '20 06:09 MaybeThisIsRu

Just saw the notification for the v0.1 release and wanted to drop by for a quick update: I have moved over to WP and at least as of now have no motivation to work on this.

To anyone else who wants to pick this up, please feel free to if you'd like, fellow interneter.

MaybeThisIsRu avatar Mar 18 '21 05:03 MaybeThisIsRu

For anyone needing a sample Docker setup, I've got one in my site's Indiekit repo. Hit me up if you need any help getting it to work (or integrating this into the official project).

sentience avatar Dec 27 '22 05:12 sentience

@paulrobertlloyd I think my Docker setup is pretty solid. It uses Docker Compose to create a MongoDB server alongside the Indiekit Node server and connects the two up, configuring them with an .env file, a sample of which is provided in the repo.

I could imagine some users would prefer to use third party managed MongoDB hosting and just run the Indiekit server themselves, so I could still make the Indiekit Dockerfile a little more flexible by declaring the environment variables necessary for this (especially MONGO_URL), to prompt the user to provide them.

I'm thinking that npm create indiekit should generate a Dockerfile for the indiekit server itself (which can be provided a MONGO_URL, etc.), and a docker-compose.yml for running Indiekit and a MongoDB server. The documentation should explain how to configure and run both of these setups.

sentience avatar Dec 29 '22 02:12 sentience

@sentience Glad you got it working. If you wanted to submit a PR to the example config repo, I think that might be a good first step in making a baseline Docker config more widely available.

@thejdev did something similar earlier this year, but that was when the project was using an older configuration file format. Maybe there are some aspects of Jaidev’s PR that could be used?

I'm thinking that npm create indiekit should generate a Dockerfile for the indiekit server itself (which can be provided a MONGO_URL, etc.), and a docker-compose.yml for running Indiekit and a MongoDB server. The documentation should explain how to configure and run both of these setups.

This is an excellent idea! This would be the perfect way to generate the required Docker config files, and I’d like to include this in the final release of v1.0.0. Happy to do this, but if you’d like to submit a PR for that too, I’d be happy to point you in the right direction.

paulrobertlloyd avatar Dec 30 '22 23:12 paulrobertlloyd

The example config now provides an example Dockerfile and related docker-compose.yml and .dockerignore files.

This means there is at least now some ‘official’ recommendation (though one that I’m happy to update based on feedback). However, given some of the environment values and other factors will vary based on an individual’s Indiekit config, I’m going to keep this issue open until I’ve added the option to create these files as part of the initialisation script.

Hopefully having such functionality will make onboarding with Docker easier, and make writing the tutorials for getting started with different hosting providers a bit easier too!

paulrobertlloyd avatar Jul 25 '23 17:07 paulrobertlloyd

With the addition of #639, there is now fuller support for Docker.

When it comes to writing tutorials for different hosting platforms, the documentation can recommend using the option to create the various Docker files as part of the initial configuration and setup step. It can also note which is these files is used by those different services (Railway doesn’t yet support Docker Compose, for example).

Thanks again for the suggestion, @sentience.

paulrobertlloyd avatar Jul 28 '23 19:07 paulrobertlloyd