azerothcore / azerothcore-wotlk

Complete Open Source and Modular solution for MMO
http://www.azerothcore.org
GNU Affero General Public License v3.0
6.41k stars 2.56k forks source link

Feature: Minimal Docker/Compose Infrastructure #14644

Open michaeldelago opened 1 year ago

michaeldelago commented 1 year ago

Describe your feature request or suggestion in detail

Hey all!

I've been looking through the Docker build and the docker-compose.yaml, and it seems like the default Docker builds are geared around development rather than deployment. I think using containers for development is fantastic, but I also think the approach recommended in the Docker setup guide should create an environment that's understandable to people who may not be familiar with AzerothCore, but are familiar with running containerized services.

Container builds (in the standard recommended method, ./acore.sh docker build) result in a few quite large containers:

$ docker image ls --filter "reference=acore/*:master"
REPOSITORY                         TAG       IMAGE ID       CREATED      SIZE
acore/ac-wotlk-worldserver-local   master    ef7d43e00b0d   5 days ago   1.58GB
acore/ac-wotlk-authserver-local    master    ea120a17973c   5 days ago   1.58GB
acore/ac-wotlk-dev-server          master    bc00ce91a1c3   5 days ago   3.17GB

It's fair to note that container builds are layered, but I personally think that layering is a "nice to have" rather than something that should be used as a main point; some deployment environments (Namely those where the authserver and the worldserver could end up on separate servers) won't be able to benefit from layering.

Going through the Dockerfile itself (as well as the docker-compose.yaml), a few things stand out to me that may be causing bloating the containers:

Other things I noticed in the Docker build that could be removed to reduce complexity:

Describe a possible solution to your feature or suggestion in detail

I think a new Dockerfile and docker-compose.yaml should be written, in order to accommodate a more minimalist docker build. Goals would include:

Secondary goals:

Additional context

I don't intend to come across as overly-critical - it's plainly obvious that a lot of time, effort, and love has gone into the development of this corner of the project. That said, I feel like there's some parts that can be improved, and one of those is something I have experience in.

From a development standpoint, I think the docker builds are fantastic, but I don't think the (likely to be very common) use case of someone stumbling on the project and wanting to spin up an idiomatic docker-compose stack is being properly met.

I'm aware of acore-docker, though I believe that repository is in a similar boat where it seems to have too much of a focus on developing Azerothcore and less on concisely describing a standard way of deploying Azerothcore. If anything, I feel like it wouldn't be terrible archive that repo, and have docker-based deployment described in this one.

I'm new to AzerothCore development, so if it seems like I'm missing something, I probably am. Please let me know!

Edit Jan 14, 23: I forgot to mention - I've begun working on the proposed changes as of earlier in the week. Currently getting the authserver to start with a ~180MB container build.

michaeldelago commented 1 year ago

It's a start, I guess

$ docker image ls --filter "reference=acore/*:docker-multi-stage"
REPOSITORY                   TAG                  IMAGE ID       CREATED          SIZE
acore/ac-wotlk-tools         docker-multi-stage   fa5bbb946c35   14 minutes ago   189MB
acore/ac-wotlk-authserver    docker-multi-stage   5c1df1171a49   14 minutes ago   168MB
acore/ac-wotlk-worldserver   docker-multi-stage   7bb0f8dbe993   14 minutes ago   769MB
acore/ac-wotlk-db-import     docker-multi-stage   3ae4da780017   14 minutes ago   160MB
acore/ac-wotlk-client-data   docker-multi-stage   30b1bc69f7c5   15 minutes ago   93.3MB

Whole set of images totals out to 1379MB

$ docker image ls --filter "reference=acore/*:docker-multi-stage" --format '{{ .Size }}' | \
    awk '{s+=$1} END {print s}'
1379.3

Compared to images created by standard build in master

$ docker image ls --filter "reference=acore/*:master"
REPOSITORY                         TAG       IMAGE ID       CREATED      SIZE
acore/ac-wotlk-worldserver-local   master    a8da0781742d   2 days ago   1.49GB
acore/ac-wotlk-authserver-local    master    71afd9658085   2 days ago   1.49GB
acore/ac-wotlk-dev-server          master    9f49a08584eb   2 days ago   3.71GB
...
$ docker image ls --filter "reference=acore/*:master"  --format '{{ .Size }}' | \
    awk '{s+=$1} END {print s}'
6.69 # GB

I haven't tested these initial images yet, I expect there to be changes needed that make them larger

michaeldelago commented 1 year ago

Hitlist and things that I think would help simplify the docker install. Please feel free to note what you'd prefer to be different

Note that this is mostly my own goals/interest for this and don't necessarily reflect AzerothCore as a whole

Vaporware: Things to explore after we reinforce the base

walkline commented 1 year ago

feat(Core): Allow full administration without the console/captive shell

Do you have any ideas how we can achieve this?