Merge branch 'develop'
commit
1bf05ecbc1
|
@ -1,5 +1,7 @@
|
|||
FROM nginx:latest
|
||||
|
||||
RUN apt update && apt install -y nano
|
||||
|
||||
# remove the default config
|
||||
RUN rm /etc/nginx/conf.d/default.conf && \
|
||||
rm /etc/nginx/nginx.conf
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
## Introduction
|
||||
|
||||
系统管理用户界面,用于MyEMS系统配置
|
||||
|
||||
Admin UI for MyEMS system settings
|
||||
|
||||
## Prerequisites
|
||||
|
@ -16,9 +17,22 @@ nginx-1.18.0 or later
|
|||
|
||||
In this section, you will install myems-admin on Docker.
|
||||
|
||||
* replace ~~127.0.0.1:8000~~ in nginx.conf with actual **HOST** ip and port of myems-api
|
||||
* Copy source code to root directory
|
||||
|
||||
On Windows:
|
||||
```bash
|
||||
cp -r myems/myems-admin c:\
|
||||
cd c:\myems-admin
|
||||
```
|
||||
|
||||
On Linux:
|
||||
```bash
|
||||
cp -r myems/myems-admin /
|
||||
cd /myems-admin
|
||||
```
|
||||
|
||||
* Manually replace ~~127.0.0.1:8000~~ in nginx.conf with actual **HOST** ip and port of myems-api
|
||||
```bash
|
||||
cd myems/myems-admin
|
||||
nano nginx.conf
|
||||
```
|
||||
|
||||
|
@ -28,17 +42,7 @@ nano nginx.conf
|
|||
|
||||
* Build a Docker image
|
||||
|
||||
On Windows:
|
||||
```bash
|
||||
cp -r myems/myems-admin c:\myems-admin
|
||||
cd c:\myems-admin
|
||||
docker build -t myems/myems-admin .
|
||||
```
|
||||
|
||||
On Linux:
|
||||
```bash
|
||||
cp -r myems/myems-admin /myems-admin
|
||||
cd /myems-admin
|
||||
docker build -t myems/myems-admin .
|
||||
```
|
||||
|
||||
|
@ -49,6 +53,7 @@ If run on Windows host, bind-mount a share upload file folder at c:\myems-upload
|
|||
```bash
|
||||
docker run -d -p 8001:8001 -v c:\myems-upload:/var/www/myems-admin/upload -v c:\myems-admin/nginx.conf:/etc/nginx/nginx.conf:ro --restart always --name myems-admin myems/myems-admin
|
||||
```
|
||||
|
||||
If run on Linux host, bind-mount a share upload file folder at /myems-upload to the container and also bind-mount nginx.conf
|
||||
```bash
|
||||
docker run -d -p 8001:8001 -v /myems-upload:/var/www/myems-admin/upload -v /myems-admin/nginx.conf:/etc/nginx/nginx.conf:ro --restart always --name myems-admin myems/myems-admin
|
||||
|
@ -72,6 +77,7 @@ If you want to immigrate the image to another computer,
|
|||
```bash
|
||||
docker save --output myems-admin.tar myems/myems-admin
|
||||
```
|
||||
|
||||
* Copy the tarball file to another computer, and then load image from tarball file
|
||||
```bash
|
||||
docker load --input .\myems-admin.tar
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
FROM python:slim
|
||||
WORKDIR /code
|
||||
|
||||
RUN apt update && apt install -y nano
|
||||
|
||||
WORKDIR /code
|
||||
COPY . /code
|
||||
RUN pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
|
||||
CMD ["python", "main.py"]
|
|
@ -6,7 +6,7 @@ Data Aggregation Service
|
|||
|
||||
## Introduction
|
||||
|
||||
This service is a component of MyEMS. It aggregates normalized data up to multiple dimensions.
|
||||
This service is a component of MyEMS to aggregate normalized data up to multiple dimensions.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
|
@ -45,22 +45,27 @@ cp -r myems/myems-aggregation /
|
|||
cd /myems/myems-aggregation
|
||||
```
|
||||
|
||||
* Duplicate example.env file as .env file and modify the .env file
|
||||
Replace ~~127.0.0.1~~ with real **HOST** IP address.
|
||||
* Create .env file based on example.env file
|
||||
|
||||
Manually replace ~~127.0.0.1~~ with real **HOST** IP address.
|
||||
|
||||
```bash
|
||||
cp example.env .env
|
||||
```
|
||||
|
||||
* Build a Docker image
|
||||
*
|
||||
```bash
|
||||
docker build -t myems/myems-aggregation .
|
||||
```
|
||||
|
||||
* Run a Docker container
|
||||
|
||||
On Windows host, bind-mount the .env to the container:
|
||||
```bash
|
||||
docker run -d -v c:\myems-aggregation\.env:/code/.env:ro --restart always --name myems-aggregation myems/myems-aggregation
|
||||
```
|
||||
|
||||
On Linux host, bind-mount the .env to the container:
|
||||
```bash
|
||||
docker run -d -v /myems-aggregation/.env:/code/.env:ro --restart always --name myems-aggregation myems/myems-aggregation
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
FROM python:slim
|
||||
WORKDIR /code
|
||||
|
||||
# RUN apt update && apt install -y nano
|
||||
|
||||
# todo: share upload folder with admin container on Docker
|
||||
RUN mkdir -p /var/www/myems-admin/upload
|
||||
|
||||
WORKDIR /code
|
||||
COPY . /code
|
||||
RUN pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
|
||||
EXPOSE 8000
|
||||
|
|
|
@ -69,25 +69,31 @@ waitress-serve --listen=127.0.0.1:8000 app:api
|
|||
|
||||
In this section, you will install myems-api on Docker.
|
||||
|
||||
* Duplicate example.env file as .env file and modify the .env file
|
||||
Replace ~~127.0.0.1~~ with real **HOST** IP address.
|
||||
```bash
|
||||
cp example.env .env
|
||||
```
|
||||
|
||||
* Build a Docker image
|
||||
* Copy source code to root directory
|
||||
|
||||
On Windows:
|
||||
```bash
|
||||
cp -r myems/myems-api c:\
|
||||
cd c:\myems-api
|
||||
docker build -t myems/myems-api .
|
||||
```
|
||||
|
||||
On Linux:
|
||||
```bash
|
||||
cp -r myems/myems-api /
|
||||
cd /myems-api
|
||||
```
|
||||
|
||||
* Create .env file based on example.env file
|
||||
|
||||
Manually replace ~~127.0.0.1~~ with real **HOST** IP address.
|
||||
|
||||
```bash
|
||||
cp example.env .env
|
||||
```
|
||||
|
||||
* Build a Docker image
|
||||
|
||||
```bash
|
||||
docker build -t myems/myems-api .
|
||||
```
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
FROM python:slim
|
||||
WORKDIR /code
|
||||
|
||||
RUN apt update && apt install -y nano
|
||||
|
||||
WORKDIR /code
|
||||
COPY . /code
|
||||
RUN pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
|
||||
CMD ["python", "main.py"]
|
|
@ -1,11 +1,12 @@
|
|||
# myems-cleaning
|
||||
|
||||
MyEMS Cleaning Service
|
||||
|
||||
MyEMS 数据清洗服务
|
||||
|
||||
## Introduction
|
||||
|
||||
This service is a component of MyEMS. It cleans the historical data.
|
||||
This service is a component of MyEMS to clean the historical data.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
|
@ -44,8 +45,10 @@ cp -r myems/myems-cleaning /
|
|||
cd /myems-cleaning
|
||||
```
|
||||
|
||||
* Duplicate example.env file as .env file and modify the .env file
|
||||
Replace ~~127.0.0.1~~ with real **HOST** IP address.
|
||||
* Create .env file based on example.env file
|
||||
|
||||
Manually replace ~~127.0.0.1~~ with real **HOST** IP address.
|
||||
|
||||
```bash
|
||||
cp example.env .env
|
||||
```
|
||||
|
@ -54,16 +57,19 @@ cp example.env .env
|
|||
```bash
|
||||
docker build -t myems/myems-cleaning .
|
||||
```
|
||||
|
||||
* Run a Docker container
|
||||
|
||||
On Windows host, bind-mount the .env to the container:
|
||||
```bash
|
||||
docker run -d -v c:\myems-cleaning\.env:/code/.env:ro --restart always --name myems-cleaning myems/myems-cleaning
|
||||
```
|
||||
|
||||
On Linux host, bind-mount the .env to the container:
|
||||
```bash
|
||||
docker run -d -v /myems-cleaning/.env:/code/.env:ro --restart always --name myems-cleaning myems/myems-cleaning
|
||||
```
|
||||
|
||||
* -d Run container in background and print container ID
|
||||
|
||||
* -v If you use -v or --volume to bind-mount a file or directory that does not yet exist on the Docker host,
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
FROM python:slim
|
||||
WORKDIR /code
|
||||
|
||||
RUN apt update && apt install -y nano
|
||||
|
||||
WORKDIR /code
|
||||
COPY . /code
|
||||
RUN pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
|
||||
CMD ["python", "main.py"]
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
### Introduction
|
||||
|
||||
This service is a component of MyEMS Community Edition to acquire data from Modbus TCP devices.
|
||||
This service is a component of MyEMS to acquire data from Modbus TCP devices.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
|
@ -45,8 +45,10 @@ cp -r myems/myems-modbus-tcp /
|
|||
cd /myems-modbus-tcp
|
||||
```
|
||||
|
||||
* Duplicate example.env file as .env file and modify the .env file
|
||||
Replace ~~127.0.0.1~~ with real **HOST** IP address.
|
||||
* Create .env file based on example.env file
|
||||
|
||||
Manually replace ~~127.0.0.1~~ with real **HOST** IP address.
|
||||
|
||||
```bash
|
||||
cp example.env .env
|
||||
```
|
||||
|
@ -55,16 +57,19 @@ cp example.env .env
|
|||
```bash
|
||||
docker build -t myems/myems-modbus-tcp .
|
||||
```
|
||||
|
||||
* Run a Docker container
|
||||
|
||||
On Windows host, bind-mount the .env to the container:
|
||||
```bash
|
||||
docker run -d -v c:\myems-modbus-tcp\.env:/code/.env:ro --restart always --name myems-modbus-tcp myems/myems-modbus-tcp
|
||||
```
|
||||
|
||||
On Linux host, bind-mount the .env to the container:
|
||||
```bash
|
||||
docker run -d -v /myems-modbus-tcp/.env:/code/.env:ro --restart always --name myems-modbus-tcp myems/myems-modbus-tcp
|
||||
```
|
||||
|
||||
* -d Run container in background and print container ID
|
||||
|
||||
* -v If you use -v or --volume to bind-mount a file or directory that does not yet exist on the Docker host,
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
FROM python:slim
|
||||
WORKDIR /code
|
||||
|
||||
RUN apt update && apt install -y nano
|
||||
|
||||
WORKDIR /code
|
||||
COPY . /code
|
||||
RUN pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
|
||||
CMD ["python", "main.py"]
|
|
@ -6,7 +6,7 @@ MyEMS Normalization Service
|
|||
|
||||
## Introduction
|
||||
|
||||
This service is a component of MyEMS. It normalizes energy data in historical database.
|
||||
This service is a component of MyEMS to normalize energy data in historical database.
|
||||
|
||||

|
||||
|
||||
|
@ -51,10 +51,10 @@ cp -r myems/myems-normalization /
|
|||
cd /myems-normalization
|
||||
```
|
||||
|
||||
* Create .env file
|
||||
* Create .env file based on example.env file
|
||||
|
||||
Manually replace ~~127.0.0.1~~ with real **HOST** IP address.
|
||||
|
||||
Duplicate example.env file as .env file and modify the .env file
|
||||
Replace ~~127.0.0.1~~ with real **HOST** IP address.
|
||||
```bash
|
||||
cp example.env .env
|
||||
```
|
||||
|
@ -63,6 +63,7 @@ cp example.env .env
|
|||
```bash
|
||||
docker build -t myems/myems-normalization .
|
||||
```
|
||||
|
||||
* Run a Docker container
|
||||
|
||||
On Windows host, bind-mount the .env to the container:
|
||||
|
|
|
@ -7,14 +7,14 @@ RUN npm run build
|
|||
|
||||
FROM nginx:latest as production-stage
|
||||
|
||||
RUN apt update && apt install -y nano
|
||||
|
||||
# remove the default config
|
||||
RUN rm /etc/nginx/conf.d/default.conf && rm /etc/nginx/nginx.conf
|
||||
|
||||
# create new root folder
|
||||
RUN mkdir -p /var/www/myems-web
|
||||
|
||||
# Note: You should run 'npm run build' in the web direction to generate the production build.
|
||||
|
||||
COPY nginx.conf /etc/nginx/
|
||||
COPY --from=build-stage /opt/build/ /var/www/myems-web
|
||||
EXPOSE 80
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
## Introduction
|
||||
|
||||
Web用户界面,用于MyEMS能源数据可视化
|
||||
|
||||
Web UI for MyEMS energy data visualization
|
||||
|
||||
## Prerequisites
|
||||
|
@ -72,21 +73,26 @@ cd myems/myems-web
|
|||
nano nginx.conf
|
||||
```
|
||||
|
||||
* Build a Docker image
|
||||
|
||||
**NOTE**: You can safely ignore the command 'npm run build' in this section, because it is built into the Dockerfile
|
||||
* Copy source code to root directory
|
||||
|
||||
On Windows:
|
||||
```bash
|
||||
cp -r myems/myems-web c:\myems-web
|
||||
cp -r myems/myems-web c:\
|
||||
cd c:\myems-web
|
||||
docker build -t myems/myems-web .
|
||||
```
|
||||
|
||||
On Linux:
|
||||
```bash
|
||||
cp -r myems/myems-web /myems-web
|
||||
cp -r myems/myems-web /
|
||||
cd /myems-web
|
||||
```
|
||||
|
||||
**NOTE**: You can safely ignore the command 'npm run build' in this section, because it is built into the Dockerfile
|
||||
|
||||
* Build a Docker image
|
||||
|
||||
```bash
|
||||
docker build -t myems/myems-web .
|
||||
```
|
||||
|
||||
|
@ -119,6 +125,7 @@ If you want to immigrate the image to another computer,
|
|||
```bash
|
||||
docker save --output myems-web.tar myems/myems-web
|
||||
```
|
||||
|
||||
* Copy the tarball file to another computer, and then load image from tarball file
|
||||
```bash
|
||||
docker load --input .\myems-web.tar
|
||||
|
|
Loading…
Reference in New Issue