Automatically set up guweb, bancho.py, mysql and caddy using Docker.
Works locally and in production.
IMPORTANT! If you don't use --recursive or download a zip from the web, you will be missing the submodules and it won't work.
git clone --recursive https://github.com/Komako-pw/bancho-guweb-stack
config.example
to config
config/tls
config/bancho.py.env
and config/guweb.py
configs to your needs
config/proxy.Caddyfile
config/proxy.env
config/mysql.env
is not necessarymkdir -p data/bancho-guweb data/mysql data/redis data/proxy
sudo chown -R 1000:1000 ./data
docker-compose up -d
You need a custom certificate authority (CA) to use HTTPS locally. Since Caddy is running in a container, it can't access your system's trusted CAs.
IMPORATNT! If you're running this on the open web, you can use
tls_auto
and skip this section.
It will ask for a Common Name (CN). Choose anything you want.
easyrsa init-pki
easyrsa build-ca nopass
pki/ca.crt
to config/tls/custom_ca/ca.crt
pki/private/ca.key
to config/tls/custom_ca/ca.key
IMPORTANT! Make sure you put it into
Trusted Root Certification Authorities
and not use automatic placement.
tls_custom_ca
mode in proxy.Caddyfile
To avoid typing docker-compose
every time, you can add an alias to your shell config.
~/.bashrc
(bash) or ~/.zshrc
(zsh)
alias dc="docker-compose"
# restart your terminal
fish:
alias dc="docker-compose"
funcsave dc
powershell (not permanent because idk how to do that):
Set-Alias -Name dc -Value docker-compose
You must add the following to your hosts file for local development:
/etc/hosts
C:\Windows\System32\drivers\etc\hosts
127.0.0.1 meow.nya a.meow.nya assets.meow.nya api.meow.nya osu.meow.nya b.meow.nya c.meow.nya c1.meow.nya c2.meow.nya c3.meow.nya c4.meow.nya c5.meow.nya c6.meow.nya ce.meow.nya
Start/stop
dc up -d
dc down
Show status
dc ps
Restart
dc restart # all services
dc restart guweb dc restart bancho dc restart mysql dc restart proxy
- Rebuild guweb or bancho (need to do this after updating the code)
```sh
dc build guweb
dc build bancho
dc up -d
Update mysql, redis and caddy to the latest versions
dc pull
dc up -d
See logs
dc logs -f # all services
dc logs -f guweb dc logs -f bancho dc logs -f mysql dc logs -f proxy
- Open a shell (go inside the container)
```sh
dc exec mysql mysql -u root -p # use MYSQL_ROOT_PASSWORD password from ./config/mysql.env
dc exec bancho bash
dc exec guweb ash
Clean old images to free up disk space
docker image prune -a
Pull upstream (will cause merge conflicts)
cd guweb
git pull upstream main
cd bancho.py git pull upstream master
- Reset data
```sh
dc down
rm -rf ./data