mirror of
https://github.com/danbulant/Shasha
synced 2026-05-27 13:51:53 +00:00
docker support
This commit is contained in:
parent
304e21f377
commit
db2d709a75
4 changed files with 17 additions and 1 deletions
1
.dockerignore
Normal file
1
.dockerignore
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
node_modules
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,6 +1,8 @@
|
||||||
config.json
|
config.json
|
||||||
package-lock.json
|
package-lock.json
|
||||||
*.sqlite3
|
*.sqlite3
|
||||||
|
pnpm-lock.yaml
|
||||||
|
config-live.json
|
||||||
|
|
||||||
# Logs
|
# Logs
|
||||||
logs
|
logs
|
||||||
|
|
|
||||||
13
Dockerfile
Normal file
13
Dockerfile
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
|
FROM node:14.15.3
|
||||||
|
ENV NODE_ENV=production
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY ["package.json", "./"]
|
||||||
|
RUN npm install --production
|
||||||
|
COPY . .
|
||||||
|
#RUN export DOCKER_HOST_IP=$(route -n | awk '/UG[ \t]/{print $2}')
|
||||||
|
ENV MONGO_HOST=mongodb://host.docker.internal:27017
|
||||||
|
|
||||||
|
CMD [ "node", "Main.js" ]
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
const { mongoServer } = require("../config.json");
|
const { mongoServer } = require("../config.json");
|
||||||
const { MongoClient, Db } = require("mongodb");
|
const { MongoClient, Db } = require("mongodb");
|
||||||
const dbClient = new MongoClient(mongoServer, {
|
const dbClient = new MongoClient(process.env.MONGO_HOST || mongoServer, {
|
||||||
useUnifiedTopology: true
|
useUnifiedTopology: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue