File tree Expand file tree Collapse file tree 4 files changed +39
-17
lines changed Expand file tree Collapse file tree 4 files changed +39
-17
lines changed Original file line number Diff line number Diff line change 59
59
platforms : linux/amd64,linux/arm64
60
60
push : true
61
61
tags : |
62
+ gaseousgames/gaseousserver:latest-embeddeddb
62
63
gaseousgames/gaseousserver:${{ github.ref_name}}-embeddeddb
64
+ ghcr.io/gaseous-project/gaseousserver:latest-embeddeddb
63
65
ghcr.io/gaseous-project/gaseousserver:${{ github.ref_name}}-embeddeddb
Original file line number Diff line number Diff line change @@ -54,8 +54,28 @@ COPY ../build/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
54
54
# clean up apt-get
55
55
RUN apt-get clean && rm -rf /var/lib/apt/lists
56
56
57
+ # set user name
58
+ ENV USER=gaseous
59
+ ENV GROUP=gaseous
60
+
61
+ # configure user
62
+ ENV PUID=1000
63
+ ENV PGID=1000
64
+ RUN groupadd -g $PGID $USER
65
+ RUN useradd -u $PUID -g $GROUP -m $USER -G sudo
66
+ RUN usermod -p "*" $USER
67
+
68
+ # create home directory
69
+ RUN mkdir -p /home/$USER/.gaseous-server /var/lib/mysql
70
+
71
+ # set permissions
72
+ RUN chown -R $USER:$GROUP /App /home/$USER/.gaseous-server /var/lib/mysql /run/mysqld
73
+
74
+ # switch to user
75
+ USER $USER
76
+
57
77
# volumes
58
- VOLUME /root /.gaseous-server /var/lib/mysql
78
+ VOLUME /home/$USER /.gaseous-server /var/lib/mysql
59
79
60
80
# start services
61
81
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- # Wait for the service to start
4
- while ! mysqladmin ping -h localhost --silent; do
5
- sleep 1
6
- done
3
+ # start the database server without network or grant tables
4
+ /usr/sbin/mariadbd --datadir=/var/lib/mysql --skip-grant-tables --skip-networking &
7
5
8
- # Set the root password
9
- mariadb -e " ALTER USER 'root'@'localhost' IDENTIFIED BY '$MARIADB_ROOT_PASSWORD ';"
6
+ # wait for the server to start
7
+ sleep 2
8
+
9
+ # change the root password
10
+ mariadb -u root -e " FLUSH PRIVILEGES; ALTER USER 'root'@'localhost' IDENTIFIED BY '$MARIADB_ROOT_PASSWORD '; FLUSH PRIVILEGES;"
11
+
12
+ # stop the server
13
+ sleep 1
14
+ killall mariadbd
15
+
16
+ # start the server normally
17
+ /usr/sbin/mariadbd --datadir=/var/lib/mysql
Original file line number Diff line number Diff line change 1
1
[supervisord]
2
- user=root
2
+ # user=abc
3
3
nodaemon=true
4
4
logfile=/dev/null
5
5
logfile_maxbytes=0
6
6
pidfile=/var/run/supervisord.pid
7
7
loglevel = INFO
8
8
9
9
[program:mariadb]
10
- command=/usr/sbin/mariadbd --user=root
11
- autostart=true
12
- autorestart=true
13
- redirect_stderr=true
14
- stdout_logfile=/dev/fd/1
15
- stdout_logfile_maxbytes=0
16
-
17
- [program:mariadb-setup]
18
10
command=bash -c "/usr/sbin/start-mariadb.sh"
19
11
autostart=true
20
- autorestart=false
12
+ autorestart=true
21
13
redirect_stderr=true
22
14
stdout_logfile=/dev/fd/1
23
15
stdout_logfile_maxbytes=0
You can’t perform that action at this time.
0 commit comments