Shadowss / TravianZ

Travian T3.6 , BEST VERSION EVER | Server restarted ! Speed 50x , Troops 50x.
GNU General Public License v3.0
202 stars 125 forks source link

Built a docker image with all the files #41

Closed johnnyip closed 1 year ago

johnnyip commented 1 year ago

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

  1. Build locally (build: .), or
  2. 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.

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.

NeotenySS commented 1 year ago

Previously it was not so necessary.