Skip to content

Commit

Permalink
PORTS, PORTS, PORTS
Browse files Browse the repository at this point in the history
  • Loading branch information
Gesugao-san committed Feb 13, 2024
1 parent 998a3d0 commit eb741d7
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
16 changes: 12 additions & 4 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,27 @@
"dockerRun": {
"image": "gesugaosan/proxima.fun",
"containerName": "proxima.fun",
"ports": [{ // HTTP
"ports": [{ // HTTP (1)
"containerPort": 80, //The port number bound on the container. Required.
"hostPort": 80, //The port number bound on the host.
"protocol": "tcp",
}, { // HTTP (2)
"containerPort": 80, //The port number bound on the container. Required.
"hostPort": 8091, //The port number bound on the host.
"protocol": "tcp",
} ,{ // WebSocket (1)
}, { // WebSocket (1)
"containerPort": 443,
"hostPort": 443,
"protocol": "tcp",
} ,{ // WebSocket (2)
}, { // WebSocket (2)
"containerPort": 3000,
"hostPort": 3000,
"protocol": "tcp",
} ,{ // Vite5
}, /* { // WebSocket (3)
"containerPort": 443,
"hostPort": 8091,
"protocol": "tcp",
},*/ { // Vite5
"containerPort": 5173,
"hostPort": 5173,
"protocol": "tcp",
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ COPY . .
### Сообщаем Docker'у, что для работы нам нужен порт.

### HTTP (1)
#EXPOSE 80:80/tcp
EXPOSE 80:80/tcp
EXPOSE 80:8091/tcp

### HTTP (2)
#EXPOSE 8080:8080/tcp

### WebSocket (1)
EXPOSE 443:443/tcp
#EXPOSE 8091:443/tcp
#EXPOSE 443:8091/tcp

### WebSocket (2)
#EXPOSE 3001:3000/tcp
Expand Down
12 changes: 11 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ services:
#WDS_SOCKET_PORT: 443
# https://docs.docker.com/compose/compose-file/compose-file-v3/#ports
ports:
- name: 'HTTP'
- name: 'HTTP (1)'
target: 80 # the port inside the container
published: 80 # the publicly exposed port
protocol: tcp
mode: host
- name: 'HTTP (2)'
target: 80 # the port inside the container
published: 8091 # the publicly exposed port
protocol: tcp
Expand All @@ -39,6 +44,11 @@ services:
published: 3000 # the publicly exposed port
protocol: tcp
mode: host
#- name: "WebSocket (3)"
#target: 443 # the port inside the container
#published: 8091 # the publicly exposed port
#protocol: tcp
#mode: host
- name: "Vite5"
target: 5173 # the port inside the container
published: 5173 # the publicly exposed port
Expand Down
3 changes: 1 addition & 2 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ export default defineConfig({
//host: true, // OK
//host: 'localhost', // NOT FOR PUBLIC
port: 80, // CRITICAL
clientPort: 80,
//https: false, // UNKNOWN
//strictPort: true, // OK
strictPort: true, // OK
//// https://vitejs.dev/config/server-options.html#server-hmr
//hmr: false
hmr: {
Expand Down

0 comments on commit eb741d7

Please sign in to comment.