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.
Voglio essere in grado di eseguire tutte le build Docker su un server di build separato rispetto a quello in cui viene eseguito il prodotto in produzione. A cosa serve Docker se richiede una serie di script da eseguire sull’host?
Sul mio host di produzione desidero avere Docker installato in modalità swarm e la possibilità di eseguire Docker login sul mio registry per scaricare le immagini necessarie. Voglio anche poter eseguire, ad esempio, 3 istanze di un qualsiasi container su 3 nodi (così che eventuali volumi o mount bind verso l’host siano facilmente gestibili).
Sono perfettamente disposto a eseguire la build e seguire esattamente il metodo supportato da Discourse su un server di staging.
Il swarm Docker in produzione di cui parlo includerà molti altri prodotti sullo stesso cluster.
Intendo eseguire docker inspect su tutti i container del server di staging ufficialmente supportato da Discourse, spingere tutte le immagini Docker pre-costruite su un registry e provare a distribuirle sul cluster swarm di produzione.
Se ci riesco, condividerò qui i risultati.
Vorrei suddividere l’architettura in più container. Da quanto ho visto, la versione ufficialmente supportata di Discourse tratta Docker come una VM ed esegue tutto in un singolo container (come si fa a scalare un solo componente se necessario?).
Forse la versione open-source supportata è volutamente non compatibile con i gestori di orchestrazione, in modo che possano ottenere contratti per gestire deploy che richiedono scalabilità massiva. Questo modello mi sta bene. Hanno tutto il diritto di guadagnare installando Discourse in grandi sistemi già esistenti di livello production basati su Swarm/Kubernetes.
Non sto dicendo che sia così che generano parte dei loro ricavi, sto solo speculando. Non è importante se lo fanno o meno, voglio solo sottolineare che non sono in alcun modo obbligati a supportare nulla oltre ai meccanismi attualmente supportati. Va semplicemente riconosciuto che il metodo supportato non è amichevole verso un cluster di orchestrazione di container di livello production.
csmu
(Keith John Hutchison - Ceiteach Seán Mac Úistin)
17
La mia comprensione è che sia per facilitare il supporto: CDKC utilizza la versione open source; guadagnano dall’hosting e questo finanzia il supporto gratuito che offrono alla versione ufficialmente supportata.
Ciao.
È maggio 2020 e questa è ancora un’area di utilizzo estremamente controversa.
Ho letto ogni thread che ho potuto trovare sul supporto attuale di Discourse per Docker e ho attraversato le 5 fasi del lutto a riguardo: ora sono arrivato alla rassegnazione.
Contesto:
Ho uno swarm Docker che esegue tutto per i nostri siti e le nostre attività. Non voglio acquistare o mantenere VPS aggiuntivi solo per ospitare un forum.
Voglio semplicemente distribuire l’immagine di Discourse con container individuali, in modo da poter scalare le cose in modo diverso secondo le necessità. Finora ho fallito. Non dovrebbe essere così difficile.
Ho fatto lo stesso con codebase molto più complessi ma paragonabili come Gitlab e Sentry in 1-2 ore esatte. Questa è la mia terza settimana nel tentativo di ottenere una soluzione funzionante con Discourse e ancora nessuna installazione affidabile.
A quanto pare…
Discourse è ricco di funzionalità, esiste da un po’ di tempo e ha contributori appassionati e competenti.
Discourse è stato uno dei primi ad adottare la containerizzazione e ha fatto ciò che ha fatto utilizzando sia gli strumenti disponibili all’epoca sia le conoscenze del momento.
Le critiche su come fa ciò che fa vengono spesso accolte con difensività.
Manca una guida chiara su questo esatto problema, che molte persone hanno sollevato negli ultimi anni e che molte altre solleveranno in futuro riguardo all’orchestrazione dei cluster.
Launcher, ecc., va bene per una singola macchina Docker; è uno script meraviglioso adatto a un caso d’uso comune. Ma la mia esperienza nell’usarlo per creare un’immagine portatile è stata un fallimento.
Cose assurde…
Le risposte passive-aggressive a preoccupazioni legittime sollevate da persone che cercano semplicemente di completare una piccola parte del loro lavoro.
Insistere sul fatto che Launcher sia l’UNICO modo in cui dovrebbe funzionare.
Riferirsi alla ‘documentazione’ in thread obsoleti e aspettarsi che le persone passino ore a leggere tali contenuti solo per installare qualcosa.
Possiamo fare di meglio.
La richiesta / l’offerta
Sono disposto a dedicare il mio tempo a qualcuno che sa come funziona Launcher per creare una guida passo dopo passo per installare container separati e ripetibili, completa di video.