Browse Source

blabla ça tourne dans docker

master
DemiSel 3 years ago
parent
commit
9ef39858ba

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

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

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

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
 
2
 
3
     public static void main(String [] args)
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
         CuisineHTTPServer vServer = new CuisineHTTPServer();
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
 
20
 public class CuisineHTTPServer extends Thread
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
     private static CuisineTCPServer fCuisineTCPServer;
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
         initResources();
39
         initResources();
36
 
40
 
37
         //Create CuisineTCPServers
41
         //Create CuisineTCPServers
141
             .append("   </style>")
145
             .append("   </style>")
142
             .append("</head>")
146
             .append("</head>")
143
             .append("<body>")
147
             .append("<body>")
144
-            .append("   <div class=\"pre\">")
148
+            .append("   <div class=\"centered\">")
145
             .append(sHtml_ASCII_title)
149
             .append(sHtml_ASCII_title)
146
             .append("   </div>")
150
             .append("   </div>")
147
             .append("   <h1 id=\"tempValue\">None</h1>")
151
             .append("   <h1 id=\"tempValue\">None</h1>")

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

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

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

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

Loading…
Cancel
Save