From 3366d926f4ec33e5d283a2d29652501882b9df94 Mon Sep 17 00:00:00 2001 From: Michael Green <84688932+michael-j-green@users.noreply.github.com> Date: Fri, 12 Jul 2024 15:43:02 +1000 Subject: [PATCH] Unraid compatible single container docker image (#390) See https://github.com/gaseous-project/unraid-template for an Unraid XML template. --- .github/workflows/BuildOnTestBranch.yml | 13 +++++++-- build/entrypoint.sh | 7 +++-- build/mariadb.sh | 5 +++- build/supervisord.conf | 2 ++ .../wwwroot/pages/settings/about.html | 28 ++++++++++++------- 5 files changed, 39 insertions(+), 16 deletions(-) diff --git a/.github/workflows/BuildOnTestBranch.yml b/.github/workflows/BuildOnTestBranch.yml index 3a11f66..7737306 100644 --- a/.github/workflows/BuildOnTestBranch.yml +++ b/.github/workflows/BuildOnTestBranch.yml @@ -27,10 +27,19 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v5 + - name: Build and push standard image + uses: docker/build-push-action@v6 with: context: . + file: ./build/Dockerfile platforms: linux/amd64,linux/arm64 push: true tags: gaseousgames/test:latest + - name: Build and push image with embedded mariadb + uses: docker/build-push-action@v6 + with: + context: . + file: ./build/Dockerfile-EmbeddedDB + platforms: linux/amd64,linux/arm64 + push: true + tags: gaseousgames/test:latest-embeddeddb \ No newline at end of file diff --git a/build/entrypoint.sh b/build/entrypoint.sh index 7e2f381..9bbfa65 100644 --- a/build/entrypoint.sh +++ b/build/entrypoint.sh @@ -3,10 +3,11 @@ # create the user echo "Creating user gaseous with UID ${PUID} and GID ${PGID}" groupadd -g ${PGID} gaseous -useradd -u ${PUID} -g ${PGID} -m gaseous -G sudo +useradd -u ${PUID} -g ${PGID} -m gaseous -d /home/gaseous -G sudo usermod -p "*" gaseous -mkdir -p /home/gaseous/.gaseous-server /var/lib/mysql -chown -R ${PUID}:${PGID} /App /home/gaseous/.gaseous-server /var/lib/mysql /run/mysqld +mkdir -p /home/gaseous/.gaseous-server /var/lib/mysql /var/log/mariadb /run/mysqld +chown -R ${PUID} /App /home/gaseous/.gaseous-server /var/lib/mysql /var/log/mariadb /run/mysqld +chgrp -R ${PGID} /App /home/gaseous/.gaseous-server /var/lib/mysql /var/log/mariadb /run/mysqld # Start supervisord and services /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf diff --git a/build/mariadb.sh b/build/mariadb.sh index 1088c90..608e80f 100644 --- a/build/mariadb.sh +++ b/build/mariadb.sh @@ -1,5 +1,8 @@ #!/bin/sh +# install the database +/usr/bin/mariadb-install-db --datadir=/var/lib/mysql --user=gaseous + # start the database server without network or grant tables /usr/sbin/mariadbd --datadir=/var/lib/mysql --skip-grant-tables --skip-networking & @@ -7,7 +10,7 @@ sleep 5 # change the root password -mariadb -u root -e "FLUSH PRIVILEGES; ALTER USER 'root'@'localhost' IDENTIFIED BY '$MARIADB_ROOT_PASSWORD'; FLUSH PRIVILEGES;" +mariadb -u root -e "FLUSH PRIVILEGES; ALTER USER 'root'@'localhost' IDENTIFIED BY '$MARIADB_ROOT_PASSWORD'; ALTER USER 'gaseous'@'localhost' IDENTIFIED BY '$MARIADB_ROOT_PASSWORD'; FLUSH PRIVILEGES; SHUTDOWN;" # stop the server sleep 5 diff --git a/build/supervisord.conf b/build/supervisord.conf index 9ccc04b..aa50ecd 100644 --- a/build/supervisord.conf +++ b/build/supervisord.conf @@ -1,4 +1,5 @@ [supervisord] +user=root nodaemon=true logfile=/var/log/supervisord/supervisord.log logfile_maxbytes=50 @@ -28,6 +29,7 @@ stdout_logfile_maxbytes=0 [program:gaseous-server] user=gaseous command=dotnet /App/gaseous-server.dll +environment=HOME="/home/gaseous",USER="gaseous" autostart=true autorestart=true redirect_stderr=true diff --git a/gaseous-server/wwwroot/pages/settings/about.html b/gaseous-server/wwwroot/pages/settings/about.html index 8ce9605..83dde1b 100644 --- a/gaseous-server/wwwroot/pages/settings/about.html +++ b/gaseous-server/wwwroot/pages/settings/about.html @@ -5,15 +5,17 @@
Home Page | -https://github.com/gaseous-project/gaseous-server | +https://github.com/gaseous-project/gaseous-server |
![]() |
|
---|---|---|---|---|
Bugs and Feature Requests | -https://github.com/gaseous-project/gaseous-server/issues | +https://github.com/gaseous-project/gaseous-server/issues | ||
Join our Discord | @@ -33,21 +35,24 @@||||
![]() |
+ ![]() |
The EmulatorJS Project - https://github.com/EmulatorJS/EmulatorJS + https://github.com/EmulatorJS/EmulatorJS |
||
Data Sources
- |
||||
- |
The Internet Game Database @@ -61,7 +66,8 @@ | |||
- ![]() ![]() |
The Old School Emulation Center @@ -70,11 +76,13 @@ | |||
- ![]() ![]() |
Progetto-Snaps - https://www.progettosnaps.net/index.php + https://www.progettosnaps.net/index.php |