commit
0b3457d7b9
36
README.md
36
README.md
|
@ -65,15 +65,49 @@ MyEMS项目由下列组件构成:
|
|||
|
||||
### Docker Docker-compose 安装
|
||||
```
|
||||
# 假定你的本机IP为: 192.168.2.3, MySQL所在IP为: 192.168.2.2
|
||||
|
||||
# 步骤一: 克隆仓库
|
||||
|
||||
git clone https://gitee.com/myems/myems.git
|
||||
|
||||
# for generate the static direction: 'build'
|
||||
|
||||
# 步骤二: 修改IP地址
|
||||
|
||||
# 你应该修改所有文件夹下中config.py的host为你的本机IP
|
||||
sudo nano myems-api/config.py
|
||||
sudo nano myems-aggregation/config.py
|
||||
sudo nano myems-cleaning/config.py
|
||||
sudo nano myems-modbus-tcp/config.py
|
||||
sudo nano myems-normalization/config.py
|
||||
# host: '127.0.0.1' => 'host': '192.168.2.2', (127.0.0.1 => mysql_ip)
|
||||
|
||||
# 你应该修改web,admin下中nginx.conf的127.0.0.1为你的本机IP
|
||||
sudo nano admin/nginx.conf
|
||||
sudo nano web/nginx.conf
|
||||
# proxy_pass http://127.0.0.1:8000/; => proxy_pass http://192.168.2.3:8000/; (127.0.0.1 => local_ip)
|
||||
|
||||
|
||||
# 步骤三: 将'web'打包生成静态文件 (React)
|
||||
|
||||
cd myems/web
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
|
||||
# 步骤四: 使用docker-compose安装
|
||||
|
||||
cd myems
|
||||
docker-compose up -d
|
||||
|
||||
|
||||
# 步骤五: 测试是否成功 (use local_ip:192.168.2.3)
|
||||
|
||||
谷歌浏览器打开:
|
||||
web page: http://192.168.2.3:8001 - 用户:administrator@myems.io 密码: !MyEMS1
|
||||
admin page: http://192.168.2.3:8002 - 用户:administrator 密码: !MyEMS1
|
||||
rest api: http://192.168.2.3:8000/spaces
|
||||
|
||||
```
|
||||
|
||||
## 功能版本对比
|
||||
|
|
45
README_DE.md
45
README_DE.md
|
@ -63,6 +63,51 @@ Dieses Projekt besteht aus folgenden Komponenten:
|
|||
|
||||
[Installieren web UI](./web/README.md)
|
||||
|
||||
### Docker Docker-compose Installieren
|
||||
```
|
||||
# Angenommen, Ihre lokale IP: 192.168.2.3 und mysql IP: 192.168.2.2
|
||||
|
||||
# Schritt 01: Klon
|
||||
|
||||
git clone https://gitee.com/myems/myems.git
|
||||
|
||||
|
||||
# Schritt 02: Ändern Sie die IP (mysql_ip: 192.168.2.2)
|
||||
|
||||
# Sie sollten den Host von config.py:
|
||||
sudo nano myems-api/config.py
|
||||
sudo nano myems-aggregation/config.py
|
||||
sudo nano myems-cleaning/config.py
|
||||
sudo nano myems-modbus-tcp/config.py
|
||||
sudo nano myems-normalization/config.py
|
||||
# host: '127.0.0.1' => 'host': '192.168.2.2', (127.0.0.1 => mysql_ip)
|
||||
|
||||
# Sie sollten den proxy_pass von nginx.conf:
|
||||
sudo nano admin/nginx.conf
|
||||
sudo nano web/nginx.conf
|
||||
# proxy_pass http://127.0.0.1:8000/; => proxy_pass http://192.168.2.3:8000/; (127.0.0.1 => local_ip)
|
||||
|
||||
|
||||
# Schritt 03: Generieren Sie die statische Richtung: 'build' for web (react)
|
||||
|
||||
cd myems/web
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
|
||||
# Schritt 04: Installieren
|
||||
|
||||
cd myems
|
||||
docker-compose up -d
|
||||
|
||||
|
||||
# Schritt 05: Prüfen (lokale ip: 192.168.2.3)
|
||||
|
||||
# mit dem Google-Browser öffnen
|
||||
web: http://192.168.2.3:8001 - Benutzer:administrator@myems.io Passwort: !MyEMS1
|
||||
admin: http://192.168.2.3:8002 - Benutzer:administrator Passwort: !MyEMS1
|
||||
api: http://192.168.2.3:8000/spaces
|
||||
```
|
||||
|
||||
### Docker Docker-compose
|
||||
```
|
||||
|
|
47
README_EN.md
47
README_EN.md
|
@ -76,6 +76,53 @@ cd myems
|
|||
docker-compose up -d
|
||||
```
|
||||
|
||||
### Docker Docker-compose Install
|
||||
```
|
||||
# Supposed that your local ip is: 192.168.2.3 and mysql ip is: 192.168.2.2
|
||||
|
||||
|
||||
# Step 01: Clone
|
||||
|
||||
git clone https://gitee.com/myems/myems.git
|
||||
|
||||
|
||||
# Step 02: Modify the ip (use mysql_ip: 192.168.2.2)
|
||||
|
||||
# You should modify the host of config.py in these directions:
|
||||
sudo nano myems-api/config.py
|
||||
sudo nano myems-aggregation/config.py
|
||||
sudo nano myems-cleaning/config.py
|
||||
sudo nano myems-modbus-tcp/config.py
|
||||
sudo nano myems-normalization/config.py
|
||||
# host: '127.0.0.1' => 'host': '192.168.2.2', (127.0.0.1 => mysql_ip)
|
||||
|
||||
# You should modify the proxy_pass of nginx.conf in these directions:
|
||||
sudo nano admin/nginx.conf
|
||||
sudo nano web/nginx.conf
|
||||
# proxy_pass http://127.0.0.1:8000/; => proxy_pass http://192.168.2.3:8000/; (127.0.0.1 => local_ip)
|
||||
|
||||
|
||||
# Step 03: Generate the static direction: 'build' for web (react)
|
||||
|
||||
cd myems/web
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
|
||||
# Step 04: Install
|
||||
|
||||
cd myems
|
||||
docker-compose up -d
|
||||
|
||||
|
||||
# Step 05: Test (use local_ip: 192.168.2.3)
|
||||
|
||||
# open with the google browser
|
||||
web page: http://192.168.2.3:8001 - user:administrator@myems.io password: !MyEMS1
|
||||
admin page: http://192.168.2.3:8002 - user:administrator password: !MyEMS1
|
||||
rest api: http://192.168.2.3:8000/spaces
|
||||
|
||||
```
|
||||
## Compare Editions
|
||||
|
||||
| Features | Community Edition | Enterprise Edition | Explanation |
|
||||
|
|
|
@ -8,4 +8,5 @@ RUN rm /etc/nginx/conf.d/default.conf && \
|
|||
# copy the config and web codes
|
||||
COPY nginx.conf /etc/nginx/
|
||||
COPY . /usr/share/nginx/admin
|
||||
EXPOSE 80
|
||||
CMD ['nginx', '-c /etc/nginx/nginx.conf', '-g "daemon off;"']
|
|
@ -26,7 +26,7 @@ http {
|
|||
keepalive_timeout 65;
|
||||
|
||||
server {
|
||||
listen 8001;
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
#access_log /var/log/nginx/host.access.log main;
|
||||
|
|
|
@ -3,31 +3,28 @@ services:
|
|||
api:
|
||||
build: ./myems-api
|
||||
command: gunicorn app:api -b 0.0.0.0:8000
|
||||
network_mode: "host"
|
||||
restart: always
|
||||
ports:
|
||||
- "8000:8000"
|
||||
|
||||
aggregation:
|
||||
build: ./myems-aggregation
|
||||
command: python main.py
|
||||
network_mode: "host"
|
||||
restart: always
|
||||
|
||||
cleaning:
|
||||
build: ./myems-cleaning
|
||||
command: python main.py
|
||||
network_mode: "host"
|
||||
restart: always
|
||||
|
||||
modbus_tcp:
|
||||
build: ./myems-modbus-tcp
|
||||
command: python main.py
|
||||
network_mode: "host"
|
||||
restart: always
|
||||
|
||||
normalization:
|
||||
build: ./myems-normalization
|
||||
command: python main.py
|
||||
network_mode: "host"
|
||||
restart: always
|
||||
|
||||
admin:
|
||||
|
@ -35,13 +32,14 @@ services:
|
|||
command: nginx -c /etc/nginx/nginx.conf -g "daemon off;"
|
||||
healthcheck:
|
||||
test: [ "CMD","nginx","-t" ]
|
||||
network_mode: "host"
|
||||
restart: always
|
||||
|
||||
ports:
|
||||
- "8001:80"
|
||||
web:
|
||||
build: ./web
|
||||
command: nginx -c /etc/nginx/nginx.conf -g "daemon off;"
|
||||
healthcheck:
|
||||
test: [ "CMD","nginx","-t" ]
|
||||
network_mode: "host"
|
||||
restart: always
|
||||
ports:
|
||||
- "8002:80"
|
|
@ -3,4 +3,5 @@ WORKDIR /code
|
|||
|
||||
COPY . /code
|
||||
RUN pip install -r requirements.txt
|
||||
EXPOSE 8000
|
||||
CMD ['gunicorn', 'app:api', '-b 0.0.0.0:8000']
|
|
@ -9,5 +9,6 @@ RUN rm /etc/nginx/conf.d/default.conf && \
|
|||
# Attention:
|
||||
# You should run 'npm run build' in the web direction to generate the build direction because this's a react projection.
|
||||
COPY nginx.conf /etc/nginx/
|
||||
COPY . /usr/share/nginx/web
|
||||
COPY ./build/ /usr/share/nginx/web
|
||||
EXPOSE 80
|
||||
CMD ['nginx', '-c /etc/nginx/nginx.conf', '-g "daemon off;"']
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue