Document how to make a compose stack out of an existing docker-compose.yml
#5
Closed
opened 2020-09-05 00:14:25 +00:00 by 3wordchant
·
4 comments
Labels
Clear labels
abra
awaiting-feedback
backups
bug
build
ci/cd
community organising
contributing
coopcloud.tech
design
documentation
duplicate
enhancement
fedi
fedi-infra
finance
funding
good first issue
help wanted
installer
legal
performance
proposal
question
security
test
wontfix
Everything to do with abra
Ping/pong on comms
Something is not working
Go build related issues
Getting the robots into the mix
Opening this thing up
Contributors stuff
Our main website
Design thinking required
Let's write things together
This issue or pull request already exists
New feature
Democratic decision making
Money things
Anything related to grant funding
Easy start with development
Need some help
Installation related issues
Performance related
Large change which requires feedback & decisin making
More information is needed
Securing our shit
Unit or integration test suite
This won't be fixed
No labels
documentation
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Assignees
3wordchant
aadil (Aadil Ayub)
abra-bot (Abra Bot)
ammaratef45
amras (Sarma)
Apfelwurm
BornDeleuze
Brooke
carla
cas (Cassowary)
coopcloud
cyrnel
decentral1se (d1)
dede
devydave
fauno (fauno)
iexos
jade (Jade Ambrose)
jjsfunhouse
jmakdah2 (Jackie Makdah)
joe-irving (Joe Irving)
kawaiipunk (KawaiiPunk)
knoflook
kolaente
lambdabundesverband
linnealovespie (April)
moosemower
moritz
notplants
oxaliq (sorrel)
p4u1
pharaohgraphy (Andrew 🐦🔥❤️🔥✴️)
renovate-bot (Comrade Renovate Bot)
ripclap
simon
sixsmith (Sixsmith)
stevensting
trav (Trav Fryer)
val (val (he/him))
yksflip
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: toolshed/organising#5
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Off top:
deploy: labels:section for Traefiknetworks: proxyto whichever service(s) will be internet-facingvolumes:and (probably)secrets:definition from an existing app.envrcfile and (probably)helpers.shto generate secrets(Probably lots more)
entrypoint.shto do any initial set-up that relies ondocker-compose run(e.g. formatrix-synapse)build:in stacksIf an image supports loading secrets from environment variables, but not yet from files, e.g. you want
CONFIG_AUTHADMINPASSWORD_FILE=/run/secrets/saml_admin_passwordbut the image only supportsCONFIG_AUTHADMINPASSWORD=foo, use a simple custom entrypoint: https://git.autonomic.zone/compose-stacks/mediawiki/src/branch/simplesaml/entrypoint.simplesaml.sh.tmplAdding custom
abracommands, see e.g. Nextcloud'sabra occcommandCoöpCloud-ising an app
Example: Matomo web analytics
Tired: Write your own image and compose file
Wired: Use someone else's image (& maybe compose file)
Inspired: Upstream image, someone else's compose file
On fire: Upstream compose file
I'm feeling lazy so, luckily for me, Matomo already has an example compose file in their repository! Let's download and edit it:
Open
compose.ymlin your favourite editor and have a gander 🦢 . There are a few things we're looking for -- full list to come -- but a few things we can immediately see are:3.8, to make sure we can use all the latest swarm coolnessabra, so we'll strip outenv_file./var/www/htmlvolume definition on L21 is a bit overzealous; it means a copy of Matomo will be stored separately per app instance, which is a waste of space in most cases. We'll narrow it down according to the documentation -- here, the developers have been nice enough to suggestlogsandconfigvolumes instead, which is a decent startinternalnetwork for it to communicate with Matomo.deploy.labelsand remove theports:definition, to tell Traefik to forward requests to Matomo based on hostname and generate an SSL certificate.(I'll also rename the
dbandappservices tomariadbandmatomorespectively, for consistency with our othercompose-stacksapps.)The resulting
compose.ymlis here: https://git.autonomic.zone/compose-stacks/matomo/src/branch/main/compose.ymlNow, create an
.envrcfile (or call it anything else, but remember to specify the-eoption forabra):(and, if you're using
.envrc, remember tosource .envrcordirenv allow)You can create the secrets:
And deploy the app:
abra deployThen, open the
DOMAINyou configured (you might need to wait a while for Traefik to generate SSL certificates) to finish the set-up.Luckily, this container is (mostly) configurable via environment variables -- if we want to auto-generate the configuration we can use a
configand / or a customentrypoint(seecompose-stacks/mediawikifor examples of both).