docker container changes

This commit is contained in:
Dobromir Popov
2021-07-30 12:45:32 +03:00
parent 676bf5f9c4
commit 28ccaba895
6 changed files with 14 additions and 16 deletions

View File

@@ -3,4 +3,5 @@ npm-debug.log
docs docs
mysql.txt mysql.txt
test.js test.js
mysql mysql

View File

@@ -4,12 +4,4 @@ COPY package*.json ./
RUN npm install RUN npm install
COPY . . COPY . .
CMD npm start CMD npm start
EXPOSE 8055 EXPOSE 2080
#
FROM mysql
ENV MYSQL_DATABASE iot
ENV MYSQL_ROOT_PASSWORD mitko2021
COPY schema.sql /docker-entrypoint-initdb.d/

View File

@@ -4,13 +4,13 @@ services:
node-app: node-app:
build: . build: .
environment: environment:
- DATABASE_HOST=db - DATABASE_HOST=node-mysql
depends_on: depends_on:
- db - node-mysql
restart: always restart: always
ports: ports:
- 8055:8055 - 2080:2080
db: node-mysql:
build: ./mysql build: ./mysql
restart: always restart: always
environment: environment:

6
mysql/Dockerfile Normal file
View File

@@ -0,0 +1,6 @@
FROM mysql
ENV MYSQL_DATABASE iot
ENV MYSQL_ROOT_PASSWORD mitko2021
COPY schema.sql /docker-entrypoint-initdb.d/

View File

@@ -5,7 +5,7 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"dev": "nodemon dht.js", "dev": "nodemon dht.js",
"start": "node dht.js" "start": "node index.js"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@@ -40,7 +40,6 @@
"mqtt": "^4.1.0", "mqtt": "^4.1.0",
"mysql": "^2.18.1", "mysql": "^2.18.1",
"mysql2": "^2.1.0", "mysql2": "^2.1.0",
"n": "^6.5.1",
"node-cron": "^2.0.3", "node-cron": "^2.0.3",
"node-uuid": "^1.4.8", "node-uuid": "^1.4.8",
"passport": "^0.4.1", "passport": "^0.4.1",