Skip to content

Commit

Permalink
Merge branch 'master' into SA08_MicroService
Browse files Browse the repository at this point in the history
  • Loading branch information
SailReal authored Nov 3, 2018
2 parents dc55486 + 88a601a commit d623c89
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 4 deletions.
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM bigtruedata/sbt

ENV DOWNLOAD www.h2database.com/h2-2018-03-18.zip
ENV DATA_DIR /opt/h2-data

EXPOSE 81 1521

# install h2 database
RUN curl ${DOWNLOAD} -o h2.zip \
&& unzip h2.zip -d /opt/ \
&& rm h2.zip \
&& mkdir -p ${DATA_DIR}

# install mongodb
RUN apt-get update
RUN apt-get install -y mongodb

# install Xvfb
RUN apt-get -y update && apt-get install -y xvfb
RUN apt-get -y update && apt-get install -y libxrender1
RUN apt-get -y update && apt-get install -y libxi6

RUN service mongodb start

WORKDIR /sudoku

ADD . /sudoku
15 changes: 11 additions & 4 deletions src/main/scala/de/htwg/se/sudoku/Sudoku.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package de.htwg.se.sudoku

import java.awt.GraphicsEnvironment

import com.google.inject.{Guice, Injector}
import de.htwg.se.sudoku.aview.gui.SwingGui
import de.htwg.se.sudoku.aview.{HttpServer, Tui}
Expand All @@ -13,8 +15,11 @@ object Sudoku {
val injector: Injector = Guice.createInjector(new MicroSudokuModule)
val controller: ControllerInterface = injector.getInstance(classOf[ControllerInterface])
val tui = new Tui(controller)
val gui = new SwingGui(controller)


if (!GraphicsEnvironment.isHeadless) {
val gui = new SwingGui(controller)
}

val fileIoHttpServer: FileIoHttpServer = injector.getInstance(classOf[FileIoHttpServer])
val webserver = new HttpServer(controller)

Expand All @@ -24,8 +29,10 @@ object Sudoku {
var input: String = ""

do {
input = readLine()
tui.processInputLine(input)
if (Console.in.ready()) {
input = readLine()
tui.processInputLine(input)
}
} while (input != "q")
webserver.unbind()
fileIoHttpServer.unbind()
Expand Down

0 comments on commit d623c89

Please sign in to comment.