Docker-compose setup for Servatrice (#3887)
* Docker compose for servatrice * Update README.md * Clean up docker-compose specific configuration
This commit is contained in:
parent
17efe8c003
commit
7285f24a29
3 changed files with 48 additions and 0 deletions
14
README.md
14
README.md
|
@ -141,6 +141,20 @@ to permit connections to the server.
|
|||
|
||||
Find more information on how to use Servatrice with Docker in our [wiki](https://github.com/Cockatrice/Cockatrice/wiki/Setting-up-Servatrice#using-docker).
|
||||
|
||||
**Docker compose**
|
||||
|
||||
There is also a docker-compose file available which will configure and run both a MySQL server and Servatrice. The docker-compose setup scripts can be found in the `servatrice/docker` folder and vary only slightly from the default sql and server .ini files. The setup scripts can either be modified in place, or docker-compose can mount alternative files into the images, as you prefer.
|
||||
|
||||
To run Servatrice via docker-compose, first install docker-compose following the [install instructions](https://docs.docker.com/compose/install/). Once installed, run the following from the root of the repository:
|
||||
```bash
|
||||
docker-compose build # Build the Servatrice image using the same Dockerfile as above.
|
||||
docker-compose up # Setup and run both the MySQL server and Servatrice.
|
||||
```
|
||||
|
||||
>Note: Similar to the above Docker setup, this will expose TCP ports 4747 and 4748.
|
||||
|
||||
>Note: The first time running the docker-compose setup, the MySQL server will take a little time to run the initial setup scripts. Due to this, the Servatrice instance may fail the first few attempts to connect to the database. Servatrice is set to `restart: always` in the docker-compose.yml, which will allow it to continue attempting to start up. Once the MySQL scripts have completed, Servatrice should then connect automatically on the next attempt.
|
||||
|
||||
# License [](https://github.com/Cockatrice/Cockatrice/blob/master/LICENSE)
|
||||
|
||||
Cockatrice is free software, licensed under the [GPLv2](https://github.com/Cockatrice/Cockatrice/blob/master/LICENSE).
|
||||
|
|
27
docker-compose.yml
Normal file
27
docker-compose.yml
Normal file
|
@ -0,0 +1,27 @@
|
|||
version: '3'
|
||||
|
||||
services:
|
||||
mysql:
|
||||
image: mysql
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=root-password
|
||||
- MYSQL_DATABASE=servatrice
|
||||
- MYSQL_USER=servatrice
|
||||
- MYSQL_PASSWORD=password
|
||||
volumes:
|
||||
- $PWD/servatrice/servatrice.sql:/docker-entrypoint-initdb.d/servatrice.sql
|
||||
|
||||
servatrice:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: servatrice
|
||||
depends_on:
|
||||
- mysql
|
||||
ports:
|
||||
- "4747:4747"
|
||||
- "4748:4748"
|
||||
entrypoint: "/bin/bash -c 'sleep 10; servatrice --config /tmp/servatrice.ini --log-to-console'"
|
||||
restart: always
|
||||
volumes:
|
||||
- $PWD/servatrice/docker/servatrice-docker.ini:/tmp/servatrice.ini
|
7
servatrice/docker/servatrice-docker.ini
Normal file
7
servatrice/docker/servatrice-docker.ini
Normal file
|
@ -0,0 +1,7 @@
|
|||
[database]
|
||||
type=mysql
|
||||
prefix=cockatrice
|
||||
hostname=mysql
|
||||
database=servatrice
|
||||
user=servatrice
|
||||
password=password
|
Loading…
Reference in a new issue