csmu
(Keith John Hutchison - Ceiteach Seán Mac Úistin)
1
I’ve been asked to make a docker-compose file for a discourse project I’m working on to make it as simple as possible for developers and sysadmins we’re working with to fire up a discourse instance to test against.
I’ve read through Can Discourse ship frequent Docker images that do not need to be bootstrapped? and came away the notions that ./launcher was really necessary in order to keep the right versions of software in play, to make installation of plugins seamless and deterministic, and to enable software upgrades via the web UI, all ./launcher was doing was working out the correct command line options to send to docker, using docker-compose to build the image did not work given the complexities involved, and interestingly, that I could just use the docker image created by ./launcher and use that with docker-compose.
I rebuilt the app, copied the final command to launch the instance, converted that to a docker-compose.yml file and started the container. I just have the init scripts to go.
I’m thinking I’d have the scripts … the initial init scripts being accessible in the shared folder and getting using docker-compose run or docker exec to get to the bootstrapping.
Has anyone done this?
Are there any guides as to what subset of scripts need to be run is the base image has already been built?
Cheers and thanks
Keith John Hutchison
Background Research.
I’ve read through install-with-docker-compose and it works well enough … main issues is it’s slightly behind the official release, and there is no command line support for discourse and rails.
I’ve since discovered that adding discourse and rails command line support will be trivial as they are bash scripts.
The main issue here was I had to bootstrap the image which is something I’ve been asked to avoid.
I restored locally after running discourse enable_restore from a staging backup and it looks good.
I’ve investigated bitnami/discourse. It worked … main issues was it was a fair bit behind the official image, quite a bit different with paths and it was slower than Install with Docker compose
No. The only supported way to run discourse is through launcher. If you do it at other way, you’re on your own. If you use bitnami you will need to get support from them, and I’m pretty sure they provide none
If you have a budget, I might be able to help. My contact info is in my profile.
csmu
(Keith John Hutchison - Ceiteach Seán Mac Úistin)
3
G’day Jay
I wasn’t asking for help with Bitnami … that was just background. It would be too different from the staging environments that uses .launcher.
But is it simple if said image ends up not being representative, lags behind official releases and said developers and sysadmins are unable to get support here?
It’s always frustrating for users when tell them their install is completely unsupported, you’re effectively asking for guidance in building another unsupportable install. Do the IndieHosters understand that you/they will be totally on their own with this?
csmu
(Keith John Hutchison - Ceiteach Seán Mac Úistin)
5
I totally agree. That’s why I suggested to our dev lead not to use the bitnami/discourse images, why he asked me to research the best way forward and why I’ve chosen to use the image(s) created by ./launcher as suggested by
So the question for me now is, how to generate the base image(s) using launcher and bring up the environment using compose?
I’ve already tried using the image created by ./launcher rebuild app.
I’m about to look at ./launcher bootstrap app.
csmu
(Keith John Hutchison - Ceiteach Seán Mac Úistin)
6
… bootstrap is called by rebuild so there would be no difference in the resultant image …
The image from bootstrap is fine, in fact it is running here on meta, PG is running on AWS RDS, Redis in a dedicated container.
csmu
(Keith John Hutchison - Ceiteach Seán Mac Úistin)
8
I know the image is fine Sam. We’re using it on a staging server. I clearly understand that what is lacking here currently is my knowledge on how to run the scripts required to setup the shared folders within docker-compose.
I am super confused at why you would even want to involve compose.
This gives your devs an ultra easy setup path on local:
In production … why would you even think about deploying with compose? In general production container orchestration happens in either scripts or kubernates or some other dedicated production tool.
csmu
(Keith John Hutchison - Ceiteach Seán Mac Úistin)
10
It’s only for testing instances
csmu
(Keith John Hutchison - Ceiteach Seán Mac Úistin)
11
Mainly because I’ve been asked to by our team lead. His argument is when testing … he doesn’t want to rely on sysadmins, or devs knowing how to set up discourse other than doing docker-compose up -d.
csmu
(Keith John Hutchison - Ceiteach Seán Mac Úistin)
12
I agree … I followed the instructions and it didn’t take a lot of time to set up. The main issue I will have is selling the idea of running the scripts
I am not associated with the OP here, but I can tell you why I want a docker compose file rather than a shell script:
Shell scripts tend to not work on Windows.
The shell script requires git, my docker hosts only have a bare OS and docker installed. They are, by design, incredibly lean and bare.
Docker compose files can, with a little work, be converted to docker swarm files which can be run on my infrastructure and managed with docker swarm management tooling.
Every other piece of my infrastructure is managed via docker-swarm tooling. Having a single piece of infrastructure that is an outlier adds a large amount of cognitive overhead that I need to store somewhere and will certainly be lost/forgotten when it comes time to upgrade (every other piece of our infrastructure gets upgrades by just updating image version in docker swarm file).
What I would like to see is a template docker swarm or docker compose file that I can use, which references an image published to Docker Hub, and I can configure by just editing the various swarm file settings.
I haven’t yet tried running the scripts locally to see if I can extract the compose file, but it sounds like that is my best bet to not have Discourse be some oddball outlier in my system. I would prefer if I didn’t need to go run a script just to generate a sample docker-compose/swarm file and if instead I could just see one in docs or a gist or something.
Quiero poder realizar todas las compilaciones de Docker en un servidor de compilación separado del entorno de producción. ¿Para qué sirve Docker si requiere un conjunto de scripts en el host?
En mi host de producción, deseo tener Docker instalado en modo swarm y la capacidad de iniciar sesión en mi registro para descargar lo necesario. También quiero poder ejecutar, por ejemplo, tres instancias de cualquier contenedor distribuidas en tres nodos (de modo que cualquier volumen o montaje vinculado al host sea fácilmente gestionable).
Estoy totalmente dispuesto a realizar la compilación y seguir exactamente el método oficial soportado por Discourse en un servidor de staging.
El swarm de Docker en producción del que hablo incluirá muchos otros productos en el mismo clúster.
Mi plan es inspeccionar con docker inspect todos los contenedores en mi servidor de staging oficialmente soportado por Discourse, subir todas las imágenes de Docker precompiladas a un registro e intentar desplegarlas en el clúster swarm de producción.
Si lo logro, lo compartiré aquí.
Me gustaría dividir la aplicación en múltiples contenedores. Por lo que he visto, la versión oficialmente soportada de Discourse trata a Docker como una máquina virtual y lo ejecuta todo en un solo contenedor (¿cómo se escala solo un componente si es necesario?).
Tal vez la versión de código abierto soportada no sea compatible con gestores de orquestación de forma intencional, para que puedan obtener contratos para gestionar despliegues que requieran una escala masiva. Ese modelo me parece bien. Tienen todo el derecho de ganar dinero instalando Discourse en sistemas Swarm/Kubernetes de producción ya establecidos y de gran escala.
No afirmo que esa sea la fuente de sus ingresos, solo especulo. No importa si es así o no; solo señalo que en absoluto están obligados a soportar nada más allá de sus mecanismos actualmente soportados. Simplemente debe reconocerse que el método soportado no es amigable con un clúster de orquestación de contenedores de nivel de producción.
csmu
(Keith John Hutchison - Ceiteach Seán Mac Úistin)
17
Mi entendimiento es que se trata de facilitar el soporte: CDKC utiliza la versión de código abierto; generan ingresos mediante el alojamiento, lo cual financia el soporte gratuito que brindan a la versión oficialmente soportada.
Hola.
Es mayo de 2020 y esto sigue siendo un área de uso completamente controvertida.
He leído todos los hilos que pude encontrar sobre el soporte actual de Discourse para Docker y he pasado por las cinco etapas del duelo con esto: ahora estoy en la resignación.
Contexto:
Tengo un clúster de Docker Swarm que ejecuta todo para nuestros sitios y negocios. No quiero comprar ni mantener VPS adicionales solo para alojar un foro.
Solo quiero desplegar la imagen de Discourse en él con contenedores individuales para poder escalar las cosas de manera diferente según sea necesario. Hasta ahora he fallado. No debería ser tan difícil.
He hecho esto con bases de código mucho más complejas pero comparables como Gitlab y Sentry en 1-2 horas exactas. Esta es mi tercera semana intentando obtener una solución funcional con Discourse y todavía no tengo una instalación fiable.
Me parece que…
Discourse es rico en funciones, lleva tiempo en el mercado y cuenta con contribuyentes apasionados y capacitados.
Discourse fue un adoptante temprano de la contenedorización y hizo lo que hizo utilizando tanto las herramientas como el conocimiento disponibles en ese momento.
La crítica sobre cómo hace lo que hace a menudo se encuentra con actitudes defensivas.
Falta una guía clara y definitiva sobre este problema exacto que muchas personas han planteado en los últimos años y que muchas más preguntarán en el futuro en relación con la orquestación de clústeres.
Launcher, etc., está bien para una sola máquina Docker; es un script hermoso que se adapta a un caso de uso común. Pero mi experiencia al intentar crear una imagen portátil con él ha sido un fracaso.
Cosas que son absurdas…
Las respuestas pasivo-agresivas a preocupaciones legítimas planteadas por personas que solo intentan completar una pequeña parte de su trabajo.
Insistir en que Launcher es la ÚNICA forma en que debería funcionar.
Referirse a la ‘documentación’ en hilos desactualizados y esperar que las personas pasen horas leyendo ese contenido simplemente para instalar algo.
Podemos hacerlo mejor que esto.
La solicitud / oferta
Estoy dispuesto a dedicar mi tiempo con alguien que sepa cómo funciona Launcher para crear una guía paso a paso para crear instalaciones de contenedores separadas y repetibles, junto con un video.