diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4683a946..235bd2c7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ services: before_script: - apk add --no-cache python3 - - pip3 install pylint requests discord.py docker pylint wolframalpha pyowm beautifulsoup4 yahoo-finance + - pip3 install -r app/requirements.txt stages: - test diff --git a/Dockerfile b/Dockerfile index 5a5b5abb..ffbadaf3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,7 @@ FROM python:3.6.2-alpine3.6 -LABEL name="Dragon Bot" +ADD app/requirements.txt /requirements.txt RUN apk update && \ - apk add --no-cache vim docker && \ - pip install requests discord.py docker pylint wolframalpha pyowm beautifulsoup4 yahoo-finance + apk add --no-cache docker && \ + pip install -r requirements.txt ADD app /app - -CMD python app/dragon-bot.py +CMD python /app/dragon-bot.py diff --git a/Dockerfile-test-env b/Dockerfile-test-env index dd3ebbba..969b2ed5 100644 --- a/Dockerfile-test-env +++ b/Dockerfile-test-env @@ -1,10 +1,10 @@ FROM python:3.6.2-alpine3.6 -LABEL name="Dragon Bot Test environment" +ADD app/requirements.txt /requirements.txt RUN apk update && \ apk add --no-cache vim docker && \ - pip install requests discord.py docker pylint wolframalpha pyowm beautifulsoup4 yahoo-finance -ADD app /app + pip install -r requirements.txt +ADD app /app RUN printf "\n\nTesting your python code for errors\n\n" && \ pylint -E /app/*.py diff --git a/app/requirements.txt b/app/requirements.txt new file mode 100644 index 00000000..f1f3e62d --- /dev/null +++ b/app/requirements.txt @@ -0,0 +1,8 @@ +beautifulsoup4 +discord.py +docker +pylint +pyowm +requests +wolframalpha +yahoo-finance