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.
Quero poder fazer toda a construção de imagens Docker em um servidor de build separado daquele onde a aplicação roda em produção. Qual o sentido de usar Docker se são necessários vários scripts no host?
No meu host de produção, quero ter o Docker instalado no modo swarm e a capacidade de fazer login no meu registro para baixar o necessário. Também quero ser capaz de executar, por exemplo, 3 instâncias de qualquer contêiner distribuídas em 3 nós (de modo que qualquer volume ou bind mount no host seja facilmente gerenciável).
Estou totalmente disposto a construir e seguir exatamente o método suportado pelo Discourse em um servidor de staging.
O swarm Docker em produção do qual estou falando incluirá muitos outros produtos no mesmo cluster.
Planejo usar o docker inspect em todos os contêineres do meu servidor de staging oficialmente suportado pelo Discourse, empurrar todas as imagens Docker pré-construídas para um registro e tentar implantá-las no cluster swarm de produção.
Se conseguir chegar lá, compartilherei aqui.
Gostaria de separar em múltiplos contêineres. Pelo que vi, a versão oficialmente suportada do Discourse trata o Docker como uma VM e faz tudo em um único contêiner (como você escalaria apenas um componente, se necessário?).
Talvez a versão de código aberto e suportada seja intencionalmente não amigável a gerenciadores de orquestração, para que possam obter contratos para gerenciar implantações que exigem escala massiva. Esse modelo me parece aceitável. Eles têm todo o direito de ganhar dinheiro instalando o Discourse em grandes sistemas Swarm/Kubernetes já estabelecidos e em nível de produção.
Não estou dizendo que essa é a forma como parte de sua receita é gerada, apenas especulando. Não importa se é ou não, apenas apontando que eles não têm nenhuma obrigação de suportar nada além de seus mecanismos atualmente suportados. Deve-se apenas reconhecer que o método suportado não é amigável para clusters de orquestração de contêineres em nível de produção.
csmu
(Keith John Hutchison - Ceiteach Seán Mac Úistin)
17
Minha compreensão é que isso visa facilitar o suporte: a CDKC usa a versão de código aberto; eles obtêm sua renda com o hospedagem, o que financia o suporte gratuito que oferecem à versão oficialmente suportada.
Olá.
Estamos em maio de 2020 e esta ainda é uma área completamente controversa de uso.
Li todos os fóruns que consegui encontrar sobre o suporte atual do Discourse para Docker e passei pelas cinco etapas do luto com isso — agora estou na resignação.
Contexto —
Tenho um swarm Docker que executa tudo para nossos sites e negócios. Não quero comprar/manter VPS adicionais apenas para hospedar um fórum.
Só quero implantar a imagem do Discourse nele com contêineres individuais para poder escalar as coisas de forma diferente conforme necessário. Até agora, falhei. Não deveria ser tão difícil.
Fiz isso com bases de código muito mais complexas, mas comparáveis, como Gitlab e Sentry, em 1 a 2 horas, sem complicação. Esta é a minha terceira semana tentando obter uma solução funcional com o Discourse e ainda não tenho uma instalação confiável.
Parece-me que…
O Discourse é rico em recursos, existe há algum tempo e tem contribuidores apaixonados e habilidosos.
O Discourse foi um dos primeiros a adotar a containerização e fez o que fez usando tanto as ferramentas quanto o conhecimento disponíveis na época.
A crítica sobre como ele faz o que faz é frequentemente recebida com defensividade.
Faltam orientações claras sobre exatamente este problema que muitas pessoas nos últimos anos levantaram e muitas mais questionarão no futuro em relação à orquestração de clusters.
O Launcher, etc., funciona bem para uma única máquina Docker; é um script lindo que atende a um caso de uso comum. Mas minha experiência ao usá-lo para criar uma imagem portátil foi um fracasso.
Coisas que são ridículas…
As respostas passivo-agressivas a preocupações legítimas levantadas por pessoas apenas tentando concluir uma pequena parte do seu trabalho.
Insistir que o Launcher é a ÚNICA maneira de funcionar.
Referir-se à ‘documentação’ em fóruns desatualizados e esperar que as pessoas passem horas tentando ler esse conteúdo apenas para instalar algo.
Podemos fazer melhor que isso.
O pedido / a oferta
Estou disposto a dedicar meu tempo com alguém que saiba como o Launcher funciona para criar um guia passo a passo para instalações de contêineres separados e repetíveis — com um vídeo.