From 8cf068c604928d2f939bf8f18bfbc98233fcbf5e Mon Sep 17 00:00:00 2001 From: mail Date: Sun, 5 May 2019 00:05:48 +0200 Subject: [PATCH] \#9 --- .dockerignore | 10 ++++++++++ Dockerfile | 18 ++++++++++++++++++ config.py-template | 2 +- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..880fb33 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,10 @@ +.gitignore +.idea +README.md +__pycache__ +_config.yml +config.py +*.iml +tweet-screnshot.png +venv + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..82e940e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM python:3.7.3 + +WORKDIR /opt/air_tweets + +COPY . . + +RUN \ + pip install --no-cache-dir -r requirements.txt \ + && mkdir -p /etc/air_tweets \ + && mkdir -p /var/air_tweets \ + && cp config.py-template /etc/air_tweets/config.py + +ENV PYTHONPATH .:/etc/air_tweets + +VOLUME /etc/air_tweets /var/air_tweets + +CMD [ "python", "./tweet.py" ] + diff --git a/config.py-template b/config.py-template index ec99428..d0cd08d 100644 --- a/config.py-template +++ b/config.py-template @@ -1,6 +1,6 @@ # database, last tweet timestamp -conf_storage = "/tmp/.air_tweet" +conf_storage = "/var/air_tweets/air_tweet" # the sensor ids conf_particle_sensor_id = 7561