Conversation
|
are those changes on config.lua.dist really necessary? |
|
See #2687 |
|
@EPuncker yea, you are right. Will remove it later today |
|
@DSpeichert my changes are simpler and dont require additional scripts |
|
@EPuncker I reverted all the changes from |
|
Bump |
|
This project don't use the repo for documentation. This project uses the wiki feature of github for documentation. Consider undoing the changes to the readme.md. Update the OP to include code blocks with the any documentation you have written. Promise you will update the wiki with the new docker documentation if these changes are merged. I don't think anyone would object to you adding a 3rd bullet point under the |
|
@soul4soul Removed documentation from README. To add new wiki page I would need some permissions. |
| image: mysql | ||
| restart: always | ||
| environment: | ||
| MYSQL_ROOT_PASSWORD: <your_root_password> |
There was a problem hiding this comment.
Try MYSQL_RANDOM_ROOT_PASSWORD: '1'
There was a problem hiding this comment.
I would use MYSQL_RANDOM_ROOT_PASSWORD instead. It does not need a root account at all, and the less privileges, the better.
| environment: | ||
| MYSQL_ROOT_PASSWORD: <your_root_password> | ||
| MYSQL_USER: forgottenserver | ||
| MYSQL_PASSWORD: <your_db_password> |
There was a problem hiding this comment.
Instead of that, try running both containers in the same network namespace and run a script that allows no password from localhost for the user.
Alternatively, try sharing a unix socket and using https://mariadb.com/kb/en/authentication-plugin-unix-socket/
There was a problem hiding this comment.
@DSpeichert that's not trivial with Docker, and I think he wants the password to be used in this "adminer" container below - I didn't even Google it, but it looks like phpMyAdmin.
There was a problem hiding this comment.
Sharing unix socket may not be easy due to uid mapping but sharing network namespaces is very easy with docker-compose:
...
services:
db:
...
pma:
network_mode: "service:db"
...
...
|
|
||
| * [Compiling](https://github.com/otland/forgottenserver/wiki/Compiling), alternatively download [AppVeyor builds for Windows](https://ci.appveyor.com/project/otland/forgottenserver) | ||
| * [Scripting Reference](https://github.com/otland/forgottenserver/wiki/Script-Interface) | ||
| * [Docker Compose](https://github.com/otland/forgottenserver/wiki/Docker-Compose) |
There was a problem hiding this comment.
I'd move this up a line, because compiling and docker are in a similar sphere related to service deployment, whereas scripting is in the sphere of dataset content creation.
| image: mysql | ||
| restart: always | ||
| environment: | ||
| MYSQL_ROOT_PASSWORD: <your_root_password> |
There was a problem hiding this comment.
I would use MYSQL_RANDOM_ROOT_PASSWORD instead. It does not need a root account at all, and the less privileges, the better.
| MYSQL_DATABASE: forgottenserver | ||
| volumes: | ||
| # Saves all the data in ./db directory | ||
| - ./db:/var/lib/mysql |
There was a problem hiding this comment.
I would use a volume here, instead of relying on the host file system.
There was a problem hiding this comment.
It's unusually hard to fish the files out of a docker-managed volume and the point here is for the data to persist, so I think this is the easy to understand option here.
There was a problem hiding this comment.
Why would you want to extract raw files from a database storage? It's not like you can do anything more with them out of the container.
There was a problem hiding this comment.
You can back them up and run a server out of them, see mariabackup etc.
There was a problem hiding this comment.
You can do the very same with volumes, just prepend docker exec to the same mysqldump -u <user> -p <password> <db> you would run.
| environment: | ||
| MYSQL_ROOT_PASSWORD: <your_root_password> | ||
| MYSQL_USER: forgottenserver | ||
| MYSQL_PASSWORD: <your_db_password> |
There was a problem hiding this comment.
@DSpeichert that's not trivial with Docker, and I think he wants the password to be used in this "adminer" container below - I didn't even Google it, but it looks like phpMyAdmin.
Copied mostly from otland#2758
|
I think we should also change: to: in |
|
Closing this as abandoned, but it could use a refresh and maybe make its way into the wiki instead. |
Docker Compose
There is also a way of running the server + database at once using
docker-compose.By default it:
forgottenserver.schema.sqlfile, so that you don't have to manually import it../dblocal directory.Preparation:
configu.lua.distwith these values, so that server properly connects to the database:Change your database user password by replacing
<your_db_password>with your password of choice.Remember to also update it in
docker-compose.yml.Change your database root password by replacing
<your_root_password>indocker-compose.yml.Start:
Stop:
Rebuild container after source code changes:
Created services:
localhost:7171,localhost:7172.localhost:8080. Allows viewing what's inside the database.Docker-compose issues:
During startup the server container is created after database, however, the database might not be initially available.
This is why the server will restart a couple of times before it successfully establishes the connection.
If you are using Docker Toolbox for Windows and it uses VirtualBox,
then the server and database explorer address host name will be
192.168.99.100insead oflocalhost.