Skip to content

Commit 4f4b7a0

Browse files
committed
Implement Dockerfile
1 parent 1836843 commit 4f4b7a0

File tree

5 files changed

+29
-3
lines changed

5 files changed

+29
-3
lines changed

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM sbtscala/scala-sbt:eclipse-temurin-17.0.4_1.7.1_3.2.0
2+
3+
RUN apt-get update && apt-get install -y libxrender1 libxtst6 libxi6
4+
5+
WORKDIR /app
6+
ADD . /app
7+
8+
ENV HEADLESS=true
9+
10+
ENTRYPOINT sbt -Djava.awt.headless=$HEADLESS run

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@ If two cards are the same and one card is different in any feature, then it is n
2222
* "Easy start" mode
2323
* Interactive GUI, game state representation as text-based UI
2424

25+
## Docker
26+
27+
You can run the SET game in a Docker container. To do so, you need to have Docker installed on your machine. Then run the following command in the root directory of the project:
28+
29+
```bash
30+
docker run -it set-game-scala
31+
```
32+
33+
If you are on Windows or Linux, you can run the following command instead to enable the GUI:
34+
35+
```bash
36+
docker run -it -e HEADLESS=false set-game-scala
37+
```
38+
2539
## License
2640

2741
Copyright © 2023-2024 Matthias Elbel & Patrick Zedler. All rights reserved.

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ lazy val root = project
22
.in(file("."))
33
.settings(
44
name := "SET Game",
5-
version := "0.1.0",
5+
version := "1.0.0",
66

77
scalaVersion := "3.3.1",
88

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.9.6
1+
sbt.version=1.9.7

src/main/scala/de/htwg/se/set/Set.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ import de.htwg.se.set.controller.IController
55
import de.htwg.se.set.module.SetModule
66
import de.htwg.se.set.view.{Gui, Tui}
77

8+
import java.awt.GraphicsEnvironment
9+
810
@main
911
def main(): Unit =
1012
val injector = Guice.createInjector(new SetModule)
1113
val controller = injector.getInstance(classOf[IController])
12-
Gui(controller)
14+
if !GraphicsEnvironment.isHeadless then Gui(controller)
1315
Tui(controller)

0 commit comments

Comments
 (0)