Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Docker support #50

Merged
merged 6 commits into from
Aug 15, 2024
Merged

Add Docker support #50

merged 6 commits into from
Aug 15, 2024

Conversation

arths31
Copy link
Contributor

@arths31 arths31 commented Jul 28, 2024

There it is, Docker support !

Thank you for this really nice retro server, brings back memories.
I used to work with Hebbo on multiple servers back in the days 😊

@arths31 arths31 marked this pull request as draft July 28, 2024 15:44
@arths31
Copy link
Contributor Author

arths31 commented Jul 28, 2024

Detected an issue while entering the hotel related with crypto.
Checking what's wrong.

@arths31 arths31 marked this pull request as ready for review July 28, 2024 15:51
@arths31
Copy link
Contributor Author

arths31 commented Jul 28, 2024

Fixed 👍🏻

@Quackster
Copy link
Owner

Thank you!

After a small review, there's a slight security risk, the RCON port is never meant to be exposed to the public.

@arths31
Copy link
Contributor Author

arths31 commented Jul 29, 2024

Oh right, I think we can remove it from ports binding/ in havana-server.
Will try that today.

@arths31
Copy link
Contributor Author

arths31 commented Jul 29, 2024

Working with port unbinded as expected.
I'll see if I can dockerize Minerva.

@arths31
Copy link
Contributor Author

arths31 commented Jul 29, 2024

Done Quackster/Minerva#2

@Cuphead74832
Copy link

Cool to see someone did my idea. Would like to know if the container is usable or still in development. (I want to know if i can beta test It)

@arths31
Copy link
Contributor Author

arths31 commented Jul 29, 2024

You can, I am already using it locally

@Cuphead74832
Copy link

You can, I am already using it locally

Nice

@Cuphead74832
Copy link

Had to delete the previous issue report due to personal data getting merged with the clipboard here is the full log of the issue when attemping to run docker-compose up, althrough this error the server finish its startup sequence but didnt test if registration worked i already assume it wont with this error but will try anyway later.

#12 0.726 2024-07-29T14:15:57.514 INFO [org.alexdev.havana.Havana] - Havana - Habbo Hotel V31 Emulation #12 0.726 2024-07-29T14:15:57.516 INFO [org.alexdev.havana.dao.Storage] - Connecting to MySQL server #12 0.762 2024-07-29T14:15:57.558 INFO [com.zaxxer.hikari.HikariDataSource] - processing - Starting... #12 0.871 2024-07-29T14:15:57.658 ERROR [com.zaxxer.hikari.pool.HikariPool] - processing - Exception during pool initialization. #12 0.871 java.sql.SQLNonTransientConnectionException: Could not connect to address=(host=127.0.0.1)(port=3306)(type=master) : Connection refused #12 0.871 at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:234) #12 0.871 at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.connException(ExceptionMapper.java:95) #12 0.871 at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1203) #12 0.871 at org.mariadb.jdbc.internal.util.Utils.retrieveProxy(Utils.java:560) #12 0.871 at org.mariadb.jdbc.MariaDbConnection.newConnection(MariaDbConnection.java:174) #12 0.871 at org.mariadb.jdbc.Driver.connect(Driver.java:92) #12 0.871 at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) #12 0.871 at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:353) #12 0.871 at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201) #12 0.871 at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:473) #12 0.871 at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:562) #12 0.871 at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) #12 0.871 at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:81) #12 0.871 at org.alexdev.havana.dao.Storage.<init>(Storage.java:51) #12 0.871 at org.alexdev.havana.dao.Storage.connect(Storage.java:72) #12 0.871 at org.alexdev.havana.Havana.main(Havana.java:96) #12 0.871 Caused by: java.net.ConnectException: Connection refused #12 0.871 at java.base/sun.nio.ch.Net.pollConnect(Native Method) #12 0.871 at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:672) #12 0.871 at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:547) #12 0.871 at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:602) #12 0.871 at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327) #12 0.871 at java.base/java.net.Socket.connect(Socket.java:633) #12 0.871 at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connect(AbstractConnectProtocol.java:501) #12 0.871 at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1195) #12 0.871 ... 13 more #12 0.877 2024-07-29T14:15:57.669 ERROR [ErrorLogger] - Error when executing MySQL query: #12 0.877 com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Could not connect to address=(host=127.0.0.1)(port=3 : Connection refused #12 0.877 at com.zaxxer.hikari.pool.HikariPool.throwPoolInitializationException(HikariPool.java:597) #12 0.877 at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:576) #12 0.877 at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) #12 0.877 at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:81) #12 0.877 at org.alexdev.havana.dao.Storage.<init>(Storage.java:51) #12 0.877 at org.alexdev.havana.dao.Storage.connect(Storage.java:72) #12 0.877 at org.alexdev.havana.Havana.main(Havana.java:96) #12 0.877 Caused by: java.sql.SQLNonTransientConnectionException: Could not connect to address=(host=127.0.0.1)(port=3306)(type=master) : Connection refused #12 0.877 at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:234) #12 0.877 at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.connException(ExceptionMapper.java:95) #12 0.877 at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1203) #12 0.877 at org.mariadb.jdbc.internal.util.Utils.retrieveProxy(Utils.java:560) #12 0.877 at org.mariadb.jdbc.MariaDbConnection.newConnection(MariaDbConnection.java:174) #12 0.877 at org.mariadb.jdbc.Driver.connect(Driver.java:92) #12 0.877 at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) #12 0.877 at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:353) #12 0.877 at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201) #12 0.877 at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:473) #12 0.877 at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:562) #12 0.877 ... 5 more #12 0.877 Caused by: java.net.ConnectException: Connection refused #12 0.877 at java.base/sun.nio.ch.Net.pollConnect(Native Method) #12 0.877 at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:672) #12 0.877 at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:547) #12 0.877 at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:602) #12 0.877 at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:) #12 0.877 at java.base/java.net.Socket.connect(Socket.java:633) #12 0.877 at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connect(AbstractConnectProtocol.java:501) #12 0.877 at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1195) #12 0.877 ... 13 more

@arths31
Copy link
Contributor Author

arths31 commented Jul 29, 2024

I see that it is trying to connect to host=127.0.0.1
Did you modify MYSQL_HOSTNAME in the variables ?

@EzpadaZ
Copy link

EzpadaZ commented Jul 30, 2024

Hi @arths31 i tried following your docker tutorial at the end of your fork.

I'm having a little issue here, i downloaded the repo set all up, fixed some issues i had on my server related to java and after all compiled i get this

2024-07-30 10:09:21 exec /havana-server/bin/run.sh: no such file or directory 2024-07-30 10:09:22 exec /havana-server/bin/run.sh: no such file or directory 2024-07-30 10:09:25 exec /havana-server/bin/run.sh: no such file or directory 2024-07-30 10:09:28 exec /havana-server/bin/run.sh: no such file or directory 2024-07-30 10:09:35 exec /havana-server/bin/run.sh: no such file or directory 2024-07-30 10:09:48 exec /havana-server/bin/run.sh: no such file or directory

Any idea? i haven't moved any folder and just added a single file to the www folder (the .exe launcher).

My original thought is that this is caused by windows somehow (i tried ubuntu in WSL2 and thats the only place at first i got it to compile) but both show this and restart in an endless loop (as configured in the docker yaml).

@arths31
Copy link
Contributor Author

arths31 commented Jul 30, 2024

I’ve tried on my Mac, I’ll check for issues on Linux as soon as possible

@arths31
Copy link
Contributor Author

arths31 commented Jul 31, 2024

Just updated the branch to cleanup Docker files.
I've just tried on Ubuntu 24.04 and it is working.

Is it working if you just clone the repository and run docker-compose up ?

@Quackster
Copy link
Owner

I will test myself and report back when I have time. Thank you very much for this PR.

@emansom
Copy link

emansom commented Aug 10, 2024

Some feedback:

  • Modify the code to read from environment variables instead of relying on server.ini modification. (supporting both, prioritizing env above ini)
  • Build the container images using jib instead. This will save on build time and total image size.

https://cloud.google.com/java/getting-started/jib
https://www.youtube.com/watch?v=H6gR_Cv4yWI

https://github.com/emansom/Kepler/blob/master/Kepler-Server/build.gradle#L18

@Quackster Quackster merged commit 09f0b1d into Quackster:master Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants