Browse Source

blabla ça tourne dans docker

master
DemiSel 3 years ago
parent
commit
9ef39858ba

+ 3
- 0
.idea/gradle.xml View File

@@ -4,8 +4,11 @@
4 4
   <component name="GradleSettings">
5 5
     <option name="linkedExternalProjectsSettings">
6 6
       <GradleProjectSettings>
7
+        <option name="delegatedBuild" value="true" />
8
+        <option name="testRunner" value="GRADLE" />
7 9
         <option name="distributionType" value="DEFAULT_WRAPPED" />
8 10
         <option name="externalProjectPath" value="$PROJECT_DIR$" />
11
+        <option name="gradleJvm" value="adopt-openjdk-14" />
9 12
         <option name="modules">
10 13
           <set>
11 14
             <option value="$PROJECT_DIR$" />

+ 14
- 0
docker/docker-compose.yml View File

@@ -0,0 +1,14 @@
1
+version: "3.0"
2
+
3
+services:
4
+  CyberCuisine:
5
+    image: openjdk:14
6
+    container_name: "CyberCuisine"
7
+    restart: always
8
+    ports:
9
+      - "10200:8080"
10
+      - "10220:6868"
11
+      - "10269:42069"
12
+    volumes:
13
+      - "./CyberCuisine.jar:/app.jar"
14
+    command: ['java', '-jar', '/app.jar']

+ 5
- 1
src/main/java/Application.java View File

@@ -2,7 +2,11 @@ public class Application {
2 2
 
3 3
     public static void main(String [] args)
4 4
     {
5
+        String vHostName = "localhost";
6
+        int vWebPagePort = 8080;
7
+        int vWebSocketPort = 42069;
8
+        int vTcpSocketPort = 6868;
5 9
         CuisineHTTPServer vServer = new CuisineHTTPServer();
6
-        vServer.startServer();
10
+        vServer.startServer(vHostName,vWebPagePort,vWebSocketPort,vTcpSocketPort);
7 11
     }
8 12
 }

+ 11
- 7
src/main/java/CuisineHTTPServer.java View File

@@ -19,19 +19,23 @@ import static io.undertow.Handlers.*;
19 19
 
20 20
 public class CuisineHTTPServer extends Thread
21 21
 {
22
-    final int webPagePort = 8080;
22
+    static int webPagePort = 8080;
23 23
 
24
-    final int webSocketPort = 42069;
25
-    final String webSocketHost = "192.168.0.24";
24
+    static int webSocketPort = 42069;
25
+    static String webSocketHost = "192.168.0.24";
26 26
 
27
-    final int tcpSocketPort = 6868;
28
-    final String HOST = "0.0.0.0" ;
27
+    static int tcpSocketPort = 6868;
28
+    static String HOST = "0.0.0.0" ;
29 29
 
30 30
 
31 31
     private static CuisineTCPServer fCuisineTCPServer;
32 32
 
33
-    public void startServer()
33
+    public void startServer(String iHostName, int iWebPagePort, int iWebSocketPort, int iTcpSocketPort)
34 34
     {
35
+        webSocketHost = iHostName;
36
+        webPagePort = iWebPagePort;
37
+        webSocketPort = iWebSocketPort;
38
+        tcpSocketPort = iTcpSocketPort;
35 39
         initResources();
36 40
 
37 41
         //Create CuisineTCPServers
@@ -141,7 +145,7 @@ public class CuisineHTTPServer extends Thread
141 145
             .append("   </style>")
142 146
             .append("</head>")
143 147
             .append("<body>")
144
-            .append("   <div class=\"pre\">")
148
+            .append("   <div class=\"centered\">")
145 149
             .append(sHtml_ASCII_title)
146 150
             .append("   </div>")
147 151
             .append("   <h1 id=\"tempValue\">None</h1>")

+ 3
- 1
src/main/resources/html_ascii_title View File

@@ -1,3 +1,4 @@
1
+<span class="pre">
1 2
    _____      _                  _____      _     _
2 3
   / ____|    | |                / ____|    (_)   (_)
3 4
  | |    _   _| |__   ___ _ __  | |    _   _ _ ___ _ _ __   ___
@@ -5,4 +6,5 @@
5 6
  | |___| |_| | |_) |  __/ |    | |___| |_| | \__ \ | | | |  __/
6 7
   \_____\__, |_.__/ \___|_|     \_____\__,_|_|___/_|_| |_|\___|
7 8
          __/ |
8
-        |___/
9
+        |___/
10
+</span>

+ 6
- 0
src/main/resources/style.css View File

@@ -1,4 +1,10 @@
1 1
 .pre{
2 2
     font-family: monospace;
3 3
     white-space: pre;
4
+}
5
+
6
+.centered{
7
+    margin : auto;
8
+    display: bloc;
9
+    width: 50%;
4 10
 }

Loading…
Cancel
Save