mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-01-19 18:44:45 +00:00
Add docker-compose file (#466)
This commit is contained in:
parent
341d7d413c
commit
6ca72ecb41
|
|
@ -27,7 +27,13 @@ by following the *[PSForever Server Connection Guide](https://docs.google.com/do
|
||||||
PSF-LoginServer is writen in [Scala](https://www.scala-lang.org/) and built using SBT, which allows it to be built on any platform. SBT is the Scala version of Make, but is more powerful as build definitions are written in Scala. SBT is distributed as a Java JAR and the only dependency it has is a JDK. [Follow the quick instructions on Scala's home page](https://www.scala-lang.org/download/) to get a working development environment and come back when you are done.
|
PSF-LoginServer is writen in [Scala](https://www.scala-lang.org/) and built using SBT, which allows it to be built on any platform. SBT is the Scala version of Make, but is more powerful as build definitions are written in Scala. SBT is distributed as a Java JAR and the only dependency it has is a JDK. [Follow the quick instructions on Scala's home page](https://www.scala-lang.org/download/) to get a working development environment and come back when you are done.
|
||||||
|
|
||||||
In order to compile scala, `scalac` is used behind the scenes. This is equivalent to Java's `javac`, but for the Scala language.
|
In order to compile scala, `scalac` is used behind the scenes. This is equivalent to Java's `javac`, but for the Scala language.
|
||||||
Scala runs on top of the Java Virtual Machine, meaning it generates `.class` and `.jar` files and uses the `java` executable. Essentially, Scala is just a compiler that targets the JVM, which is its runtime. All of this runs in the background and is packaged automatically by your IDE or SBT, which automatically downloads the right version of the Scala compiler for you.
|
Scala runs on top of the Java Virtual Machine, meaning it generates `.class` and `.jar` files and
|
||||||
|
uses the `java` executable. Essentially, Scala is just a compiler that targets the JVM, which is its
|
||||||
|
runtime. All of this runs in the background and is packaged automatically by your IDE or SBT, which
|
||||||
|
automatically downloads the right version of the Scala compiler for you.
|
||||||
|
|
||||||
|
If you have Docker and docker-compose installed on your system, you can get a complete development
|
||||||
|
environment up by running `docker-compose up` in the source code directory. Otherwise, keep reading.
|
||||||
|
|
||||||
### Using an IDE
|
### Using an IDE
|
||||||
Scala code can be fairly complex and a good IDE helps you understand the code and what methods are available for certain types, especially as you are learning the language.
|
Scala code can be fairly complex and a good IDE helps you understand the code and what methods are available for certain types, especially as you are learning the language.
|
||||||
|
|
|
||||||
36
docker-compose.yml
Normal file
36
docker-compose.yml
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
version: "3"
|
||||||
|
services:
|
||||||
|
loginserver:
|
||||||
|
image: mozilla/sbt:8u232_1.3.8
|
||||||
|
volumes:
|
||||||
|
- .:/PSF-Loginserver:z
|
||||||
|
working_dir: /PSF-Loginserver
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
ports:
|
||||||
|
- 51000-51001:51000-51001/udp
|
||||||
|
- 51002:51002/tcp
|
||||||
|
command: >
|
||||||
|
sh -c '
|
||||||
|
if [ ! -f "config/worldserver.ini" ]; then
|
||||||
|
sed "s/Hostname = \"localhost\"/Hostname = \"db\"/g" config/worldserver.ini.dist > config/worldserver.ini
|
||||||
|
fi
|
||||||
|
if [ ! -d "pscrypto-lib" ]; then
|
||||||
|
wget https://github.com/psforever/PSCrypto/releases/download/v1.1/pscrypto-lib-1.1.zip
|
||||||
|
unzip pscrypto-lib-1.1.zip
|
||||||
|
rm pscrypto-lib-1.1.zip
|
||||||
|
fi
|
||||||
|
sbt pslogin/run
|
||||||
|
'
|
||||||
|
adminer:
|
||||||
|
image: adminer
|
||||||
|
ports:
|
||||||
|
- 51010:8080
|
||||||
|
db:
|
||||||
|
image: postgres
|
||||||
|
volumes:
|
||||||
|
- ./schema.sql:/docker-entrypoint-initdb.d/schema.sql:z
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: psforever
|
||||||
|
POSTGRES_PASSWORD: psforever
|
||||||
|
POSTGRES_DATABASE: psforever
|
||||||
Loading…
Reference in a new issue