Docker setup

This commit is contained in:
Arne van Iterson 2024-02-08 11:56:05 +01:00
parent 745ba4d903
commit 09b175f88d
6 changed files with 3357 additions and 888 deletions

2
.dockerignore Normal file
View File

@ -0,0 +1,2 @@
.git
node_modules

17
Dockerfile Normal file
View File

@ -0,0 +1,17 @@
FROM node:18-alpine as base
WORKDIR /src
COPY package*.json /
EXPOSE 2428
FROM base as production
ENV NODE_ENV=production
RUN npm ci
COPY . /
CMD ["node", "bin/www"]
FROM base as dev
ENV NODE_ENV=development
RUN npm install -g nodemon && npm install
COPY . /
CMD ["nodemon", "bin/www"]

14
docker-compose.yml Normal file
View File

@ -0,0 +1,14 @@
version: '3.8'
services:
web:
build:
context: ./
target: dev
volumes:
- .:/src
command: npm run start:dev
ports:
- "2428:2428"
environment:
NODE_ENV: development
DEBUG: nodejs-docker-express:*

4204
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -23,11 +23,11 @@
"colors": "^1.4.0", "colors": "^1.4.0",
"express": "^4.17.1", "express": "^4.17.1",
"gamedig": "^2.0.23", "gamedig": "^2.0.23",
"markdown-it": "^10.0.0", "markdown-it": "^13.0.1",
"os": "^0.1.1", "os": "^0.1.1",
"socket.io": "^3.0.1", "socket.io": "^4.5.4",
"striptags": "^3.1.1", "striptags": "^3.1.1",
"systeminformation": "^4.16.0" "systeminformation": "^5.15.1"
}, },
"devDependencies": { "devDependencies": {
"eslint": "^7.13.0", "eslint": "^7.13.0",