mirror of
https://github.com/danbulant/Shasha
synced 2026-05-19 03:58:38 +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
|
||||
package-lock.json
|
||||
*.sqlite3
|
||||
pnpm-lock.yaml
|
||||
config-live.json
|
||||
|
||||
# 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 { MongoClient, Db } = require("mongodb");
|
||||
const dbClient = new MongoClient(mongoServer, {
|
||||
const dbClient = new MongoClient(process.env.MONGO_HOST || mongoServer, {
|
||||
useUnifiedTopology: true
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue