Begin working on docker intergration

This commit is contained in:
2021-01-23 23:57:30 +11:00
parent a983d60b32
commit d0b383f5de
7 changed files with 9183 additions and 21 deletions
+1
View File
@@ -0,0 +1 @@
node_modules
+15
View File
@@ -0,0 +1,15 @@
FROM node:15.6
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
ENV PORT=3000
EXPOSE 3000
CMD [ "npm", "start" ]
+17
View File
@@ -0,0 +1,17 @@
version: '3.8'
services:
web:
build: .
ports:
- "3000:3000"
mongo:
image: mongo
environment:
MONGO_INITDB_ROOT_PASSWORD_FILE: ./mongo-auth.dev
volumes:
- db-data:/db-data
volumes:
db-data:
+2
View File
@@ -0,0 +1,2 @@
MONGO_INITDB_ROOT_USERNAME=username
MONGO_INITDB_ROOT_PASSWORD=password
+9145 -18
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -9,7 +9,7 @@
"build:server": "exit 0", "build:server": "exit 0",
"build:client": "webpack --env=production --config webpack.config.js", "build:client": "webpack --env=production --config webpack.config.js",
"dev": "concurrently npm:watch:server npm:watch:client", "dev": "concurrently npm:watch:server npm:watch:client",
"watch:server": "nodemon server/server.js --ext js,jsx,json", "watch:server": "nodemon . --ext js,jsx,json --ignore 'node_modules/*'",
"watch:client": "webpack serve --env=development --config webpack.config.js", "watch:client": "webpack serve --env=development --config webpack.config.js",
"analyzer": "webpack --env=production --analyzer --config webpack.config.js" "analyzer": "webpack --env=production --analyzer --config webpack.config.js"
}, },
+2 -2
View File
@@ -16,11 +16,11 @@ app.use(formidable());
app.use('/api/accounts', require('./accounts')); app.use('/api/accounts', require('./accounts'));
//send static files //send static files
app.use('/', express.static(path.resolve('../public'))); app.use('/', express.static(path.resolve(__dirname, 'public')));
//fallback to the index file //fallback to the index file
app.get('*', (req, res) => { app.get('*', (req, res) => {
res.sendFile(path.resolve(`../public/index.html`)); res.sendFile(path.resolve(__dirname, 'public' , 'index.html'));
}); });
//startup //startup