Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker version #51

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**/

!Crypto feeds.csv
!requirements.txt
!news-analysis.py
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
__pycache__
*.pyc

.idea/
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM python:3.9-alpine as building

RUN /usr/local/bin/python -m pip install --upgrade pip && \
apk add --update --no-cache gcc g++ musl-dev libffi-dev openssl-dev python3-dev

COPY requirements.txt /requirements.txt

RUN apk add curl && curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable && source $HOME/.cargo/env

RUN source $HOME/.cargo/env && pip install -r /requirements.txt --no-cache-dir --prefer-binary

RUN python -m nltk.downloader vader_lexicon


FROM python:3.9-alpine as final

RUN apk add --update --no-cache g++

COPY --from=building /root/nltk_data /usr/local/share/nltk_data
COPY --from=building /usr/local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages
COPY * /

ENTRYPOINT ["python", "news-analysis.py"]
Loading