Default docker config changes and startup improvements

Altered the default configuration to be more compatible with parallel installations out-of-the-box.  Added a SQL script that runs when the database is first created to add a pair of default users.
This commit is contained in:
Christian 'ketura' McCarty
2021-01-05 21:07:49 -06:00
parent 55e7fc1645
commit 8ba8c6fd1f
5 changed files with 31 additions and 15 deletions

View File

@@ -4,7 +4,7 @@ services:
build:
container_name: gemp_app
container_name: gemp_app_1
build:
context: .
dockerfile: gemp_app.Dockerfile
@@ -17,7 +17,7 @@ services:
# target means in the container
- target: 80
# published is what's on the host machine
published: 1337
published: 17001
volumes:
- type: bind
source: ../gemp-lotr-async/src/main/web
@@ -29,14 +29,14 @@ services:
source: ../gemp-lotr-async/src/main/web
target: /var/www/localhost/htdocs/gemp-lotr #/etc/apache2/htdocs/gemp-lotr
networks:
gemp_net:
ipv4_address: 172.28.1.1
gemp_net_1:
ipv4_address: 172.28.1.2
tty: true
command: nohup java -jar /etc/gemp-lotr/gemp-lotr-async/target/web.jar &
#command: nohup java -jar /etc/gemp-lotr/gemp-lotr-async/target/web.jar &
db:
container_name: gemp_db
container_name: gemp_db_1
build:
context: ..
dockerfile: docker/gemp_db.Dockerfile
@@ -45,15 +45,15 @@ services:
# target means in the container
- target: 3306
# published is what's on the host machine
published: 3307
published: 35001
restart: always
volumes:
- type: bind
source: ../../database
target: /var/lib/mysql
networks:
gemp_net:
ipv4_address: 172.28.1.2
gemp_net_1:
ipv4_address: 172.28.1.3
environment:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: gemp_db
@@ -62,8 +62,8 @@ services:
networks:
gemp_net:
gemp_net_1:
ipam:
driver: default
config:
- subnet: 172.28.0.0/16
- subnet: 172.28.1.0/16

View File

@@ -1 +0,0 @@
COMPOSE_PROJECT_NAME=gemp-lotr-sandbox

View File

@@ -1,4 +1,4 @@
FROM mariadb AS MariaDB
#COPY ./database_script.sql /etc/gemp/database_script.sql
COPY ./database_script.sql /docker-entrypoint-initdb.d
COPY ./docker/initial_user_setup.sql /docker-entrypoint-initdb.d

View File

@@ -0,0 +1,17 @@
INSERT INTO player (name, password, type, last_login_reward, last_ip, create_ip)
VALUES (
'asdf',
'f0e4c2f76c58916ec258f246851bea091d14d4247a2fc3e18694461b1816e13b',
'aut',
'20170101',
'192.168.50.1',
'192.168.50.1'
),
(
'qwer',
'f6f2ea8f45d8a057c9566a33f99474da2e5c6a6604d736121650e2730c6fb0a3',
'aut',
'20170101',
'192.168.50.1',
'192.168.50.1'
);

View File

@@ -27,7 +27,7 @@ gemp_app is slightly more complicated. Gemp is a Java server, is built using Ma
4B- under db/environment, note all of the username/password fields. If you are hosting this for something other than personal development, be sure to change all of these to something else.
4C- note the two "published" ports: 1337 for the app, and 3307 for the db. These are the ports that you will be accessing the site with (and the db if you connect with a database manager). If you are hosting this for something other than personal development, consider changing these to something else. DO NOT change the "target" ports.
4C- note the two "published" ports: 17001 for the app, and 35001 for the db. These are the ports that you will be accessing the site with (and the db if you connect with a database manager). If you are hosting this for something other than personal development, consider changing these to something else. DO NOT change the "target" ports.
5- If you changed SQL credentials in step 4, navigate to gemp-lotr/gemp-lotr/gemp-lotr-commond/src/main/resources/ and open gemp-lotr.properties:
@@ -64,7 +64,7 @@ You should see "Starting gemp_app....done" and "Starting gemp_db....done" at the
docker-compose down
docker-compose up -d
11- if all has gone as planned, you should now be able to navigate to your own personal instance of Gemp. Open your browser of choice and navigate to http://localhost:1337/gemp-lotr/ . (If you need a different port to be bound to, then repeat step 5 and edit the exposed port.)
11- if all has gone as planned, you should now be able to navigate to your own personal instance of Gemp. Open your browser of choice and navigate to http://localhost:17001/gemp-lotr/ . (If you need a different port to be bound to, then repeat step 5 and edit the exposed port.)
If you're presented with the home page, register a new user and log in. It's possible for the login page to present but login itself to fail if configured incorrectly, so don't celebrate until you see the (empty) lobby. If you get that far, then congrats, you now have a working local version of Gemp.