I made a docker image for the whole repository, pack everything into the PHP docker base image, and install all required dependencies.
It is effortless to spin up the DB and the PHP server within one command by either build the docker image locally, or using the docker-compose scripts.
Usage example
Build a local docker image (using the Dockerfile)
docker build .
Start the game db and PHP server (using the docker-compose.yaml)
In the docker-compose.yaml, you can either
Build locally (build: .), or
Pull the image that I built (unclechuen/travianz:latest) from docker hub
Comment out either one of them, then open terminal, navigate to any folder you want, and run the following command.
docker-compose up -d
In that dir, 2 folders will be created automatically.
./db/ is the data for MySQL server. The db password can be modified at the docekr-compose.yaml
./html/ is the game file folder. Upon the execution of docker-compose script, all the files (from this repo) will be copied to the folder. It is linked to the game image by using volume binding. You can modify or backup those files.
One odd thing I have found is that the "localhost" value for the database connection may not work, as each container is further divided into individual env. May need to use the IP address of the host machine to make it work.
I made a docker image for the whole repository, pack everything into the PHP docker base image, and install all required dependencies.
It is effortless to spin up the DB and the PHP server within one command by either build the docker image locally, or using the docker-compose scripts.
Usage example
Build a local docker image (using the Dockerfile)
Start the game db and PHP server (using the docker-compose.yaml)
In the docker-compose.yaml, you can either
Comment out either one of them, then open terminal, navigate to any folder you want, and run the following command.
In that dir, 2 folders will be created automatically.
One odd thing I have found is that the "localhost" value for the database connection may not work, as each container is further divided into individual env. May need to use the IP address of the host machine to make it work.