Docker added
This commit is contained in:
parent
8cf6520224
commit
157c0e13a7
3 changed files with 39 additions and 68 deletions
|
|
@ -1,8 +1,6 @@
|
||||||
# syntax=docker/dockerfile:1
|
|
||||||
FROM node:current-slim
|
FROM node:current-slim
|
||||||
ENV NODE_ENV=production
|
|
||||||
WORKDIR /app-authentication
|
WORKDIR /app-authentication
|
||||||
COPY ["package.json", "package-lock.json*", "./"]
|
COPY ["package.json", "package-lock.json*", "./"]
|
||||||
RUN npm install --production
|
RUN npm install --NODE_ENV
|
||||||
COPY . .
|
COPY . .
|
||||||
CMD [ "node", "server.js" ]
|
CMD [ "node", "server.js" ]
|
||||||
|
|
@ -6,7 +6,9 @@ let db;
|
||||||
module.exports = {
|
module.exports = {
|
||||||
connectToServer: function( callback ) {
|
connectToServer: function( callback ) {
|
||||||
MongoClient.connect( uri, { useNewUrlParser: true, useUnifiedTopology: true }, function( err, client ) {
|
MongoClient.connect( uri, { useNewUrlParser: true, useUnifiedTopology: true }, function( err, client ) {
|
||||||
|
console.log(client.isConnected());
|
||||||
db = client.db(config.mongodbDatabase);
|
db = client.db(config.mongodbDatabase);
|
||||||
|
|
||||||
return callback( err );
|
return callback( err );
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,82 +1,53 @@
|
||||||
version: '3.7'
|
version: '3.8'
|
||||||
networks:
|
|
||||||
net:
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
frontend:
|
|
||||||
image: frontend
|
|
||||||
environment:
|
|
||||||
SERVICE_ADRESS: frontend
|
|
||||||
SERVICE_PORT: 4200
|
|
||||||
ports:
|
|
||||||
- 4200:4200
|
|
||||||
networks:
|
|
||||||
- net
|
|
||||||
|
|
||||||
service-authentication:
|
service-authentication:
|
||||||
image: service-authentication
|
build: backend/service-authentication
|
||||||
|
command: node server.js
|
||||||
|
volumes:
|
||||||
|
- backend/service-authentication
|
||||||
|
- backend/service-authentication/node_modules
|
||||||
|
ports:
|
||||||
|
- 3001:3000
|
||||||
|
depends_on:
|
||||||
|
- mongodb-authentication
|
||||||
environment:
|
environment:
|
||||||
SERVICE_ADRESS: service-authentication
|
NODE_ENV: development
|
||||||
SERVICE_PORT: 3000
|
|
||||||
ports:
|
|
||||||
- 3000:3000
|
|
||||||
networks:
|
|
||||||
- net
|
|
||||||
|
|
||||||
service-message:
|
service-message:
|
||||||
image: service-message
|
build: backend/service-message
|
||||||
|
command: node server.js
|
||||||
|
volumes:
|
||||||
|
- backend/service-message
|
||||||
|
- backend/service-message/node_modules
|
||||||
|
ports:
|
||||||
|
- 3000:3000
|
||||||
|
depends_on:
|
||||||
|
- mongodb-message
|
||||||
environment:
|
environment:
|
||||||
SERVICE_ADRESS: service-message
|
NODE_ENV: development
|
||||||
SERVICE_PORT: 3000
|
|
||||||
ports:
|
|
||||||
- 3001:3000
|
|
||||||
networks:
|
|
||||||
- net
|
|
||||||
service-notification:
|
|
||||||
image: service-notification
|
|
||||||
environment:
|
|
||||||
SERVICE_ADRESS: service-notification
|
|
||||||
SERVICE_PORT: 3000
|
|
||||||
ports:
|
|
||||||
- 3002:3000
|
|
||||||
networks:
|
|
||||||
- net
|
|
||||||
|
|
||||||
service-privateroom:
|
|
||||||
image: service-privateroom
|
|
||||||
environment:
|
|
||||||
SERVICE_ADRESS: service-privateroom
|
|
||||||
SERVICE_PORT: 3000
|
|
||||||
ports:
|
|
||||||
- 3003:3000
|
|
||||||
networks:
|
|
||||||
- net
|
|
||||||
|
|
||||||
mongodb-authentication:
|
mongodb-authentication:
|
||||||
image: mongo
|
image: mongo
|
||||||
networks:
|
container_name: mongodb-authentication
|
||||||
- net
|
environment:
|
||||||
|
- PUID=1001
|
||||||
|
- PGID=1001
|
||||||
|
volumes:
|
||||||
|
- ./backend/service-authentication/database:/data/db
|
||||||
ports:
|
ports:
|
||||||
- 27017:27017
|
- 27017:27017
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
mongodb-message:
|
mongodb-message:
|
||||||
image: mongo
|
image: mongo
|
||||||
networks:
|
container_name: mongodb-message
|
||||||
- net
|
environment:
|
||||||
|
- PUID=1000
|
||||||
|
- PGID=1000
|
||||||
|
volumes:
|
||||||
|
- ./backend/service-message/database:/data/db
|
||||||
ports:
|
ports:
|
||||||
- 27020:27017
|
- 27020:27017
|
||||||
|
restart: unless-stopped
|
||||||
mongodb-notification:
|
|
||||||
image: mongo
|
|
||||||
networks:
|
|
||||||
- net
|
|
||||||
ports:
|
|
||||||
- 27021:27017
|
|
||||||
|
|
||||||
mongodb-privateroom:
|
|
||||||
image: mongo
|
|
||||||
networks:
|
|
||||||
- net
|
|
||||||
ports:
|
|
||||||
- 27022:27017
|
|
||||||
Reference in a new issue