Merge pull request #906 from madsboddum/docker_compose_mongo

Created a docker-compose.yml, which initializes and runs a mongo instance
This commit is contained in:
Josh Larson
2022-11-29 17:52:20 -06:00
committed by GitHub
5 changed files with 45 additions and 8 deletions
+1
View File
@@ -49,3 +49,4 @@ gradle.properties
/bin/
*.db
*.iff
mongo_data
+9 -8
View File
@@ -25,21 +25,22 @@ by running `java -version`.
The project uses submodules. Get them by running: git submodule update --init
## MongoDB ##
User information is read from a MongoDB database that can be run on any machine on your network. Default is the machine that Holocore is running on.
A MongoDB instance can be bootstrapped by running `docker-compose up -d`.
1. Create database: `use cu`
2. Create your game user: `db.users.insert({"username": "user", "password": "pass", "accessLevel": "dev", "banned": false, "characters": []})`
This will run and initialize a MongoDB instance with a default game server user.
* Username: user
* Password: pass
Enabling the Character Builder Terminals:
1. Switch to the relevant database: `use cu`
2. Enable the character builder: `db.config.insertOne({ "package": "support.data.dev", "characterBuilder": true })`
This will also run a web UI, which can be accessed in the browser at: http://localhost:8081
You can stop both with: `docker-compose down`.
## Running Holocore ##
Compile and run Holocores main code using Gradle: `./gradlew run`
Compile and run Holocores main code using Gradle: `./gradlew runDevelopment`
## Running automated tests ##
Compile and run Holocores automated tests using Gradle: `./gradlew test --info`
# Running your own server #
If you're interesting in running your own server, you should use the provided
If you're interested in running your own server, you should use the provided
Docker image.
+24
View File
@@ -0,0 +1,24 @@
version: '3.1'
services:
mongo:
image: mongo:5.0.14
restart: always
ports:
- "27017:27017"
environment:
MONGO_INITDB_DATABASE: cu
volumes:
- ./mongo_data:/data/db
- ./mongo_init_scripts:/docker-entrypoint-initdb.d
mongo-express:
image: mongo-express:0.54.0
restart: always
depends_on:
- mongo
ports:
- "8081:8081"
environment:
ME_CONFIG_MONGODB_URL: mongodb://mongo:27017/
+4
View File
@@ -0,0 +1,4 @@
db.config.insertOne({
package: "support.data.dev",
characterBuilder: true
});
+7
View File
@@ -0,0 +1,7 @@
db.users.insert({
username: "user",
password: "pass",
accessLevel: "dev",
banned: false,
characters: []
});