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 Deployment #4

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
__pycache__/
*.py[cod]
*$py.class
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# SWAMI KARUPPASWAMI THUNNAI

FROM python:3.6

RUN apt update
RUN apt install apache2 apache2-dev -y

RUN mkdir -p /var/www/candle_stick
COPY . /var/www/candle_stick
WORKDIR /var/www/candle_stick

RUN wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
RUN tar -xvf ta-lib-0.4.0-src.tar.gz
RUN cd ta-lib && ./configure --prefix=/usr
WORKDIR /var/www/candle_stick/ta-lib
RUN make
RUN make install
WORKDIR /var/www/candle_stick
RUN pip3 install -r requirements.txt
RUN pip3 install -t /usr/local/lib/python3.6/site-packages mod_wsgi
WORKDIR /var/www/candle_stick/docker_conf
RUN cat module.conf >> /etc/apache2/apache2.conf
RUN cat virtual_host.conf > /etc/apache2/sites-enabled/000-default.conf
RUN chmod -R 777 /var/www/candle_stick/datasets
WORKDIR /var/www/candle_stick
CMD ["apachectl", "-D", "FOREGROUND"]
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,10 @@ web-based technical screener for candlestick patterns using TA-Lib, Python, and

* Candlestick Pattern Recognition - https://www.youtube.com/watch?v=QGkf2-caXmc
* Building a Web-based Technical Screener - https://www.youtube.com/watch?v=OhvQN_yIgCo
* Finding Breakouts - https://www.youtube.com/watch?v=exGuyBnhN_8
* Finding Breakouts - https://www.youtube.com/watch?v=exGuyBnhN_8

## Building Docker Image
```
docker build -t candlestick .
docker container run --publish 80:80 --detach candlestick
```
Binary file removed __pycache__/app.cpython-37.pyc
Binary file not shown.
Binary file removed __pycache__/patterns.cpython-37.pyc
Binary file not shown.
7 changes: 7 additions & 0 deletions candle_stick.wsgi
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SWAMI KARUPPASWAMI THUNNAI

import sys

sys.path.insert(0, "/var/www/candle_stick")

from app import app as application
1 change: 1 addition & 0 deletions docker_conf/module.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LoadModule wsgi_module "/usr/local/lib/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so"
16 changes: 16 additions & 0 deletions docker_conf/virtual_host.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<VirtualHost *:80>
WSGIScriptAlias / /var/www/candle_stick/candle_stick.wsgi
WSGIDaemonProcess candle_stick threads=2 inactivity-timeout=60
WSGIProcessGroup candle_stick
WSGIApplicationGroup %{GLOBAL}
<Directory /var/www/candle_stick/>
Order allow,deny
Allow from all
</Directory>
Alias /static/ /var/www/candle_stick/static/
<Directory /var/www/candle_stick/static/>
Order allow,deny
Allow from all
</Directory>
LogLevel warn
</VirtualHost>
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
flask
TA-Lib
pandas
yfinance
yfinance