From 2253af81183f1b75e2d3e867e93c4fb89310861d Mon Sep 17 00:00:00 2001 From: cupcakearmy Date: Mon, 23 Dec 2019 10:45:38 +0100 Subject: [PATCH] docker cleanup --- .dockerignore | 7 +++++++ Dockerfile | 9 +++++---- docker-compose.dev.yml | 8 ++++++++ docker-compose.yml | 3 +-- requirements.txt | 14 +++++++------- 5 files changed, 28 insertions(+), 13 deletions(-) create mode 100644 .dockerignore create mode 100644 docker-compose.dev.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b57d9c6 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +# Ignore everything +** + +!/requirements.txt +!/src + +**/__pycache__ diff --git a/Dockerfile b/Dockerfile index 34f37dd..3ac9f6b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,9 @@ FROM python:3-slim + + WORKDIR /app - COPY requirements.txt . -RUN pip install --no-cache-dir -r requirements.txt && rm -rf /root/.cache - +RUN pip install --no-cache-dir -r requirements.txt COPY src . -CMD ["python", "-u", "/app/Mercatus.py"] \ No newline at end of file + +CMD ["python", "-u", "/app/mercatus.py"] \ No newline at end of file diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml new file mode 100644 index 0000000..d8b9c97 --- /dev/null +++ b/docker-compose.dev.yml @@ -0,0 +1,8 @@ +version: '3.7' + +services: + bot: + build: . + volumes: + - ./data.db:/app/data.db + - ./config.yml:/app/config.yml:ro diff --git a/docker-compose.yml b/docker-compose.yml index 72083e3..8fb709c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,10 +1,9 @@ -version: '3.6' +version: '3.7' services: bot: image: cupcakearmy/mercatus restart: unless-stopped - command: ["python", "-u", "/app/Mercatus.py"] volumes: - ./data.db:/app/data.db - ./config.yml:/app/config.yml:ro diff --git a/requirements.txt b/requirements.txt index 1c97e82..5799cd8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ -pytimeparse==1.1.8 -alpha-vantage==2.1.2 -matplotlib==3.1.2 -numpy==1.17.4 -pandas==0.25.3 -python-telegram-bot==12.2 -PyYAML==5.2 \ No newline at end of file +pytimeparse==1.1.* +alpha-vantage==2.1.* +matplotlib==3.1.* +numpy==1.18.* +pandas==0.25.* +python-telegram-bot==12.2.* +PyYAML==5.* \ No newline at end of file