feat: add Dockerfile

This commit is contained in:
Axel Cocat 2022-03-15 01:13:38 +01:00
parent a462b6af1b
commit 1b7e975080
8 changed files with 60 additions and 13 deletions

20
.dockerignore Normal file
View file

@ -0,0 +1,20 @@
# Dependency directories
node_modules/
# Build directory
build/
# Downloaded data files
data/*
!data/*.csv
!data/background.png
# Configuration
config.json
.env
# Log files
*.log
# Git folder
.git/

View file

@ -10,12 +10,12 @@ ACORE_ARMORY_REALMS__0__REALM_ID=1
ACORE_ARMORY_REALMS__0__AUTH_DATABASE="acore_auth" ACORE_ARMORY_REALMS__0__AUTH_DATABASE="acore_auth"
ACORE_ARMORY_REALMS__0__CHARACTERS_DATABASE__HOST="localhost" ACORE_ARMORY_REALMS__0__CHARACTERS_DATABASE__HOST="localhost"
ACORE_ARMORY_REALMS__0__CHARACTERS_DATABASE__PORT=3306 ACORE_ARMORY_REALMS__0__CHARACTERS_DATABASE__PORT=3306
ACORE_ARMORY_REALMS__0__CHARACTERS_DATABASE__USER="root" ACORE_ARMORY_REALMS__0__CHARACTERS_DATABASE__USER="acore"
ACORE_ARMORY_REALMS__0__CHARACTERS_DATABASE__PASSWORD="root" ACORE_ARMORY_REALMS__0__CHARACTERS_DATABASE__PASSWORD="acore"
ACORE_ARMORY_REALMS__0__CHARACTERS_DATABASE__DATABASE="acore_characters" ACORE_ARMORY_REALMS__0__CHARACTERS_DATABASE__DATABASE="acore_characters"
ACORE_ARMORY_WORLD_DATABASE__HOST="localhost" ACORE_ARMORY_WORLD_DATABASE__HOST="localhost"
ACORE_ARMORY_WORLD_DATABASE__PORT=3306 ACORE_ARMORY_WORLD_DATABASE__PORT=3306
ACORE_ARMORY_WORLD_DATABASE__USER="root" ACORE_ARMORY_WORLD_DATABASE__USER="acore"
ACORE_ARMORY_WORLD_DATABASE__PASSWORD="root" ACORE_ARMORY_WORLD_DATABASE__PASSWORD="acore"
ACORE_ARMORY_WORLD_DATABASE__DATABASE="acore_world" ACORE_ARMORY_WORLD_DATABASE__DATABASE="acore_world"
ACORE_ARMORY_DB_QUERY_TIMEOUT=10000 ACORE_ARMORY_DB_QUERY_TIMEOUT=10000

8
Dockerfile Normal file
View file

@ -0,0 +1,8 @@
FROM node:16
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
CMD [ "npm", "start" ]

View file

@ -16,8 +16,8 @@
"charactersDatabase": { "charactersDatabase": {
"host": "localhost", "host": "localhost",
"port": 3306, "port": 3306,
"user": "root", "user": "acore",
"password": "root", "password": "acore",
"database": "acore_characters" "database": "acore_characters"
} }
} }
@ -25,8 +25,8 @@
"worldDatabase": { "worldDatabase": {
"host": "localhost", "host": "localhost",
"port": 3306, "port": 3306,
"user": "root", "user": "acore",
"password": "root", "password": "acore",
"database": "acore_world" "database": "acore_world"
}, },
"dbQueryTimeout": 10000 "dbQueryTimeout": 10000

19
docker-compose.yml Normal file
View file

@ -0,0 +1,19 @@
services:
armory:
restart: unless-stopped
build:
context: .
dockerfile: Dockerfile
volumes:
- ./data:/data/
- ./logs:/logs/
env_file:
- .env
networks:
- local-private-net
ports:
- 48733:48733
networks:
local-private-net:
driver: bridge

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{ {
"name": "azerothcore-armory", "name": "azerothcore-armory",
"version": "0.11.0", "version": "0.12.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "azerothcore-armory", "name": "azerothcore-armory",
"version": "0.11.0", "version": "0.12.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@supercharge/promise-pool": "^2.1.0", "@supercharge/promise-pool": "^2.1.0",

View file

@ -1,6 +1,6 @@
{ {
"name": "azerothcore-armory", "name": "azerothcore-armory",
"version": "0.11.0", "version": "0.12.0",
"description": "", "description": "",
"scripts": { "scripts": {
"build": "tsc -p tsconfig.json", "build": "tsc -p tsconfig.json",

View file

@ -38,8 +38,8 @@ export class Armory {
), ),
transports: [ transports: [
new winston.transports.Console({ level: "debug" }), new winston.transports.Console({ level: "debug" }),
new winston.transports.File({ filename: "armory.error.log", level: "error" }), new winston.transports.File({ filename: path.join("logs", "armory.error.log"), level: "error" }),
new winston.transports.File({ filename: "armory.combined.log", level: "http" }), new winston.transports.File({ filename: path.join("logs", "armory.combined.log"), level: "http" }),
], ],
}); });
this.charsetCache = {}; this.charsetCache = {};