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
mysql.txt
test.js
mysql
mysql

View File

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

View File

@@ -4,13 +4,13 @@ services:
node-app:
build: .
environment:
- DATABASE_HOST=db
- DATABASE_HOST=node-mysql
depends_on:
- db
- node-mysql
restart: always
ports:
- 8055:8055
db:
- 2080:2080
node-mysql:
build: ./mysql
restart: always
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",
"scripts": {
"dev": "nodemon dht.js",
"start": "node dht.js"
"start": "node index.js"
},
"repository": {
"type": "git",
@@ -40,7 +40,6 @@
"mqtt": "^4.1.0",
"mysql": "^2.18.1",
"mysql2": "^2.1.0",
"n": "^6.5.1",
"node-cron": "^2.0.3",
"node-uuid": "^1.4.8",
"passport": "^0.4.1",