5okin
4 years ago
5 changed files with 89 additions and 0 deletions
@ -0,0 +1,11 @@ |
|||||
|
InfluxDatabaseName = 'env_data' |
||||
|
InfluxAdminUser = 'admin' |
||||
|
InfluxAdminPass = 'admin' |
||||
|
InfluxUser = 'flask' |
||||
|
InfluxUserPass = 'pass' |
||||
|
|
||||
|
GRAFANA_USERNAME = 'admin' |
||||
|
GRAFANA_PASSWORD = 'admin' |
||||
|
|
||||
|
MailUser = 'rpi.iot.weatherserver@gmail.com' |
||||
|
MailPass = '94gVQfbzP3nV48B' |
@ -0,0 +1,10 @@ |
|||||
|
FROM python:3 |
||||
|
|
||||
|
WORKDIR /usr/src/app |
||||
|
|
||||
|
COPY requirements.txt ./ |
||||
|
RUN pip install --no-cache-dir -r requirements.txt |
||||
|
|
||||
|
COPY . . |
||||
|
|
||||
|
CMD [ "python", "./run_server.py" ] |
@ -0,0 +1,57 @@ |
|||||
|
version: '3.4' |
||||
|
|
||||
|
services: |
||||
|
|
||||
|
weather_station_server: |
||||
|
container_name: "weather_server" |
||||
|
environment: |
||||
|
TZ: Europe/Athens |
||||
|
build: . |
||||
|
environment: |
||||
|
MAILUSER: ${MailUser} |
||||
|
MAILPASS: ${MailPass} |
||||
|
INFLUXDB_DATABASE: ${InfluxDatabaseName} |
||||
|
INFLUXDB_USERNAME: ${InfluxUser} |
||||
|
INFLUXDB_PASSWORD: ${InfluxUserPass} |
||||
|
depends_on: |
||||
|
- influxdb |
||||
|
ports: |
||||
|
- 5000:80 |
||||
|
|
||||
|
grafana: |
||||
|
container_name: "grafana" |
||||
|
image: grafana/grafana:latest |
||||
|
depends_on: |
||||
|
- influxdb |
||||
|
environment: |
||||
|
GF_SECURITY_ADMIN_USER: ${GRAFANA_USERNAME} |
||||
|
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_PASSWORD} |
||||
|
INFLUXDB_DATABASE: ${InfluxDatabaseName} |
||||
|
INFLUXDB_USERNAME: ${InfluxUser} |
||||
|
INFLUXDB_PASSWORD: ${InfluxUserPass} |
||||
|
ports: |
||||
|
- 3000:3000 |
||||
|
volumes: |
||||
|
- ./grafana-provisioning/:/etc/grafana/provisioning |
||||
|
- grafanadata:/var/lib/grafana |
||||
|
|
||||
|
influxdb: |
||||
|
environment: |
||||
|
INFLUXDB_DB: ${InfluxDatabaseName} |
||||
|
INFLUXDB_ADMIN_USER: ${InfluxAdminUser} |
||||
|
INFLUXDB_ADMIN_PASSWORD: ${InfluxAdminPass} |
||||
|
INFLUXDB_HTTP_AUTH_ENABLED: "true" |
||||
|
INFLUXDB_USER: ${InfluxUser} |
||||
|
INFLUXDB_USER_PASSWORD: ${InfluxUserPass} |
||||
|
container_name: "influxdb" |
||||
|
image: influxdb:latest |
||||
|
#ports: |
||||
|
# - 8086:8086 |
||||
|
volumes: |
||||
|
- influxdata:/var/lib/influxdb |
||||
|
|
||||
|
volumes: |
||||
|
influxdata: |
||||
|
driver: local |
||||
|
grafanadata: |
||||
|
driver: local |
@ -0,0 +1,7 @@ |
|||||
|
Flask==1.1.2 |
||||
|
Flask-RESTful==0.3.8 |
||||
|
Flask-PyMongo==2.3.0 |
||||
|
tweepy==3.10.0 |
||||
|
flask-PyMongo==2.3.0 |
||||
|
pymongo==3.11.2 |
||||
|
influxdb==5.3.1 |
@ -0,0 +1,4 @@ |
|||||
|
from app import app |
||||
|
|
||||
|
|
||||
|
app.run(host='0.0.0.0', port=80, debug=True) |
Loading…
Reference in new issue