dockerized

This commit is contained in:
choelzl 2021-06-22 12:06:23 +02:00
parent f9930b2ada
commit 12d588c56d
Signed by: sora
GPG Key ID: A362EA0491E2EEA0
7 changed files with 1407 additions and 0 deletions

2
.dockerignore Normal file
View File

@ -0,0 +1,2 @@
node_modules
npm-debug.log

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
node_modules/

19
Dockerfile Normal file
View File

@ -0,0 +1,19 @@
FROM node:14
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
RUN npm install
# If you are building your code for production
# RUN npm ci --only=production
# Bundle app source
COPY . .
EXPOSE 8080
CMD [ "node", "server.js" ]

20
docker-compose.yml Normal file
View File

@ -0,0 +1,20 @@
version: "3.9"
networks:
external:
external: true
services:
gitea:
build: ./
dockerfile: Dockerfile
container_name: startpage
networks:
- external
labels:
- "traefik.enable=true"
- "traefik.http.routers.gitea.entrypoints=web-secure"
- "traefik.http.routers.gitea.rule=Host(`start.helcel.net`)"
- "traefik.http.routers.gitea.tls=true"
- "traefik.http.services.gitea.loadbalancer.server.port=8080"
- "traefik.docker.network=external"
restart: always

1326
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

19
package.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "startpage",
"version": "1.0.0",
"description": "StartPage",
"author": "Sora",
"main": "server.js",
"scripts": {
"start": "node server.js"
},
"dependencies": {
"fastify": "^3.18.0",
"fastify-static": "^4.2.2"
},
"repository": {
"type": "git",
"url": "git@git.helcel.net:sora/startpage.git"
},
"license": "ISC"
}

20
server.js Normal file
View File

@ -0,0 +1,20 @@
'use strict';
// Constants
const PORT = 8080;
const HOST = '0.0.0.0';
const fastify = require('fastify')()
const path = require('path')
fastify.register(require('fastify-static'), {
root: path.join(__dirname),
})
fastify.get('/', function (req, reply) {
return reply.sendFile('index.html');
})
fastify.listen(PORT, HOST);
console.log(`Running on http://${HOST}:${PORT}`);