Browse Source

Upload files to 'server'

master
5okin 4 years ago
parent
commit
480006cfb1
  1. 11
      server/.env
  2. 10
      server/Dockerfile
  3. 57
      server/docker-compose.yml
  4. 7
      server/requirements.txt
  5. 4
      server/run_server.py

11
server/.env

@ -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'

10
server/Dockerfile

@ -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" ]

57
server/docker-compose.yml

@ -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

7
server/requirements.txt

@ -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

4
server/run_server.py

@ -0,0 +1,4 @@
from app import app
app.run(host='0.0.0.0', port=80, debug=True)
Loading…
Cancel
Save