diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..206568c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +node_modules/ +certs/ +.git/ +.DS_Store +.gitignore +README.md +nodemon.json +*.service diff --git a/.gitignore b/.gitignore index 332bbc0..3efccf1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ **/.DS_Store node_modules/ certs/ +docker-compose*.yml +!docker-compose-example.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e3b1c45 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM --platform=linux/amd64 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" ] + diff --git a/docker-compose-example.yml b/docker-compose-example.yml new file mode 100644 index 0000000..de3f038 --- /dev/null +++ b/docker-compose-example.yml @@ -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 diff --git a/public/index.html b/public/index.html index 1dd6909..8e1595b 100644 --- a/public/index.html +++ b/public/index.html @@ -51,6 +51,13 @@
Enter the address of the server you would like to connect to:
+ + +