dockerized
This commit is contained in:
parent
f9930b2ada
commit
12d588c56d
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
node_modules
|
||||||
|
npm-debug.log
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
node_modules/
|
19
Dockerfile
Normal file
19
Dockerfile
Normal 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
20
docker-compose.yml
Normal 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
1326
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
19
package.json
Normal file
19
package.json
Normal 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
20
server.js
Normal 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}`);
|
Loading…
x
Reference in New Issue
Block a user