Komako-pw / bancho-guweb-stack

Automatically run guweb, bancho.py, mysql and caddy using Docker.
MIT License
4 stars 1 forks source link
bancho banchopy docker docker-compose guweb osu osu-game osu-server osugame

guweb + bancho.py stack

Automatically set up guweb, bancho.py, mysql and caddy using Docker.

Works locally and in production.

Setup

Custom CA

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.

easyrsa init-pki
easyrsa build-ca nopass

Alias

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

Hosts

You must add the following to your hosts file for local development:

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

Relevant commands

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

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

cd bancho.py git pull upstream master


- Reset data
```sh
dc down
rm -rf ./data

License

MIT