dockerisation 🐬

This commit is contained in:
ari melody 2023-10-03 20:39:47 +01:00
parent 6ced824e1c
commit 3331925b3d
No known key found for this signature in database
GPG key ID: 12A070A0ACDCA45F
5 changed files with 40 additions and 1 deletions

8
.dockerignore Normal file
View file

@ -0,0 +1,8 @@
node_modules/
certs/
.git/
.DS_Store
.gitignore
README.md
nodemon.json
*.service

2
.gitignore vendored
View file

@ -1,3 +1,5 @@
**/.DS_Store **/.DS_Store
node_modules/ node_modules/
certs/ certs/
docker-compose*.yml
!docker-compose-example.yml

15
Dockerfile Normal file
View file

@ -0,0 +1,15 @@
FROM node:20-alpine3.18
# set working directory
WORKDIR /srv/openterminal
# install dependencies
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
EXPOSE 8080
CMD [ "node", "./server/main.js" ]

View file

@ -0,0 +1,14 @@
version: "3.9"
services:
web:
build: .
image: openterminal
container_name: openterminal
ports:
- 443:443
volumes:
- ./certs/cert.crt:/srv/openterminal/certs/cert.crt
- ./certs/cert.key:/srv/openterminal/certs/cert.key
environment:
PORT: 443
restart: unless-stopped

View file

@ -65,7 +65,7 @@ This connection will now terminate.
`; `;
const PORT = process.env.PORT || 8080; const PORT = process.env.PORT || 8443;
const PING_INTERVAL = 10000; const PING_INTERVAL = 10000;
let sockets = []; let sockets = [];