Skip to content

Commit

Permalink
Fix WSS
Browse files Browse the repository at this point in the history
  • Loading branch information
Gesugao-san committed Feb 13, 2024
1 parent a409c74 commit f9f3973
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 13 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ env:
REGISTRY: docker.io #ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: gesugaosan/proxima.fun:latest #$github.repository
WDS_SOCKET_PORT: 443

jobs:
push_to_registry:
Expand Down
4 changes: 2 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
"image": "gesugaosan/proxima.fun",
"containerName": "proxima.fun",
"ports": [{
"containerPort": 8080,
"hostPort": 8080,
"containerPort": 80,
"hostPort": 80,
"protocol": "tcp",
}],
"env": {
Expand Down
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ FROM node:21-alpine

### Устанавливаем кодировку.
#RUN apt update && apt -y install locales && locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
ENV WDS_SOCKET_PORT=443

### Информация об этом пакете.
LABEL name="gesugaosan/proxima.fun"
Expand Down Expand Up @@ -53,7 +54,7 @@ RUN npm install --production --silent
COPY . .

### Сообщаем Docker'у, что для работы нам нужен порт.
EXPOSE 8080:8080
EXPOSE 80:80

### Устанавливаем владельцем node для рабочего каталога рекурсивно.
RUN chown -R node /usr/src/app
Expand Down
4 changes: 2 additions & 2 deletions README.Docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
When you're ready, start your application by running:
`docker compose up --build`.

Your application will be available at http://localhost:8080.
Your application will be available at http://localhost:80.

### Deploying your application to the cloud

Expand All @@ -19,4 +19,4 @@ Consult Docker's [getting started](https://docs.docker.com/go/get-started-sharin
docs for more detail on building and pushing.

### References
* [Docker's Node.js guide](https://docs.docker.com/language/nodejs/)
* [Docker's Node.js guide](https://docs.docker.com/language/nodejs/)
7 changes: 4 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ services:
build:
context: .
tags:
- "latest"
- 'latest'
dockerfile: ./Dockerfile
environment:
NODE_ENV: production
WDS_SOCKET_PORT: 443
ports:
- target: 8080
published: 8080
- target: 80
published: 80
mode: host

# The commented out section below is an example of how to define a PostgreSQL
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"preview": "vite preview",
"dev": "vite",
"docker-build": "docker build . -t \"gesugaosan/proxima.fun\"",
"docker-run": "docker run -p 8080:8080/tcp \"gesugaosan/proxima.fun\""
"docker-run": "docker run -p 80:80/tcp \"gesugaosan/proxima.fun\""
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.5.1",
Expand Down
8 changes: 7 additions & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ export default defineConfig({

server: {
host: true,
port: 8080,
port: 80,
https: true,
strictPort: true,
hmr: {
host: true,
protocol: 'wss',
clientPort: 443,
},
}
})

0 comments on commit f9f3973

Please sign in to comment.