Merge branch 'docker' into develop
commit
9f7eefce10
|
@ -66,6 +66,14 @@ MyEMS项目由下列组件构成:
|
|||
|
||||
[安装 web UI](./web/README.md)
|
||||
|
||||
|
||||
### Docker Docker-compose 安装
|
||||
```
|
||||
git clone https://gitee.com/myems/myems.git
|
||||
cd myems
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
## 功能版本对比
|
||||
| 功能 |社区版 |企业版 | 说明 |
|
||||
| :--- | :----: | :----: | :----: |
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
FROM nginx
|
||||
|
||||
# remove the config
|
||||
RUN rm /etc/nginx/conf.d/default.conf && \
|
||||
rm /etc/nginx/nginx.conf && \
|
||||
mkdir -p /usr/share/nginx/web && \
|
||||
mkdir -p /usr/share/nginx/admin
|
||||
|
||||
# copy the config and web codes
|
||||
COPY ./nginx.conf /etc/nginx/
|
||||
COPY ./web/build/ /usr/share/nginx/web
|
||||
COPY ./admin/ /usr/share/nginx/admin
|
||||
CMD ['nginx', '-c /etc/nginx/nginx.conf', '-g "daemon off;"']
|
|
@ -0,0 +1,5 @@
|
|||
FROM nginx
|
||||
WORKDIR /code
|
||||
|
||||
COPY . /usr/share/nginx/html
|
||||
CMD ['nginx', '-c /etc/nginx/nginx.conf', '-g "daemon off;"']
|
|
@ -0,0 +1,54 @@
|
|||
version: '3'
|
||||
services:
|
||||
api:
|
||||
build: ./myems-api
|
||||
command: gunicorn app:api -b 0.0.0.0
|
||||
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
|
||||
|
||||
web-docker:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Web-Dockerfile
|
||||
command: nginx -c /etc/nginx/nginx.conf -g "daemon off;"
|
||||
healthcheck:
|
||||
test: [ "CMD","nginx","-t" ]
|
||||
network_mode: "host"
|
||||
restart: always
|
||||
|
||||
# web:
|
||||
# build: ./web
|
||||
# command: nginx -c /etc/nginx/nginx.conf -g "daemon off;"
|
||||
# healthcheck:
|
||||
# test: [ "CMD","nginx","-t" ]
|
||||
# network_mode: "host"
|
||||
# restart: always
|
||||
# ports:
|
||||
# - "10001:80"
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
FROM python:3.7
|
||||
WORKDIR /code
|
||||
|
||||
COPY . /code
|
||||
RUN pip install -r requirements.txt
|
|
@ -0,0 +1 @@
|
|||
mysql-connector
|
|
@ -0,0 +1,5 @@
|
|||
FROM python:3.7
|
||||
WORKDIR /code
|
||||
|
||||
COPY . /code
|
||||
RUN pip install -r requirements.txt
|
|
@ -0,0 +1,9 @@
|
|||
version: '3'
|
||||
services:
|
||||
web:
|
||||
build: .
|
||||
ports:
|
||||
- "8000:8000"
|
||||
volumes:
|
||||
- .:/code
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
anytree
|
||||
simplejson
|
||||
mysql.connector
|
||||
falcon
|
||||
falcon_cors
|
||||
falcon-multipart
|
||||
gunicorn
|
||||
openpyxl
|
|
@ -0,0 +1,5 @@
|
|||
FROM python:3.7
|
||||
WORKDIR /code
|
||||
|
||||
COPY . /code
|
||||
RUN pip install -r requirements.txt
|
|
@ -0,0 +1,2 @@
|
|||
mysql-connector
|
||||
schedule
|
|
@ -0,0 +1,5 @@
|
|||
FROM python:3.7
|
||||
WORKDIR /code
|
||||
|
||||
COPY . /code
|
||||
RUN pip install -r requirements.txt
|
|
@ -0,0 +1,3 @@
|
|||
mysql-connector
|
||||
modbus_tk
|
||||
schedule
|
|
@ -0,0 +1,5 @@
|
|||
FROM python:3.7
|
||||
WORKDIR /code
|
||||
|
||||
COPY . /code
|
||||
RUN pip install -r requirements.txt
|
|
@ -0,0 +1,3 @@
|
|||
mysql-connector
|
||||
openpyxl
|
||||
sympy
|
|
@ -0,0 +1,74 @@
|
|||
user nginx;
|
||||
worker_processes auto;
|
||||
|
||||
error_log /var/log/nginx/error.log notice;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/log/nginx/access.log main;
|
||||
|
||||
sendfile on;
|
||||
#tcp_nopush on;
|
||||
|
||||
keepalive_timeout 65;
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
#access_log /var/log/nginx/host.access.log main;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/web;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
#error_page 404 /404.html;
|
||||
|
||||
# redirect server error pages to the static page /50x.html
|
||||
#
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
server {
|
||||
listen 8001;
|
||||
server_name localhost;
|
||||
|
||||
#access_log /var/log/nginx/host.access.log main;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/admin;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
#error_page 404 /404.html;
|
||||
|
||||
# redirect server error pages to the static page /50x.html
|
||||
#
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
FROM nginx
|
||||
WORKDIR /code
|
||||
|
||||
COPY ./build/ /usr/share/nginx/html
|
||||
#CMD ['nginx', '-c /etc/nginx/nginx.conf', '-g "daemon off;"']
|
Loading…
Reference in New Issue