Skip to content

Commit

Permalink
added dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
liadmagen committed Dec 17, 2018
1 parent ea8ec1a commit 0c8d2d1
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 16 deletions.
33 changes: 17 additions & 16 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"name": "Keep Current - Web Miner and Document finder",
"description":
"It opens an API for cron to trigger a search or update the query",
"image": "heroku/python",
"repository": "https://github.com/Keep-Current/Web-Miner",
"keywords": ["python", "crawler", "miner", "flask"],
"environments": {
"test": {
"scripts": {
"test-setup": "python manage.py collectstatic --noinput",
"test": "python manage.py test"
}
}
}
}
{
"name": "Keep Current - Web Miner and Document finder",
"description":
"It opens an API for cron to trigger a search or update the query",
"image": "heroku/python",
"repository": "https://github.com/Keep-Current/Web-Miner",
"keywords": ["python", "crawler", "miner", "flask"],
"stack": "heroku-16",
"environments": {
"test": {
"scripts": {
"test-setup": "python app.py collectstatic --noinput",
"test": "python app.py test"
}
}
}
}
21 changes: 21 additions & 0 deletions deploy/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM wearedevelopers/alpine-ml:v0.6

LABEL MAINTAINER="https://github.com/Keep-Current/web-miner"

WORKDIR /usr/local/bin
WORKDIR /usr/local/engine

COPY ./requirements.txt ./

RUN apk update && \
apk --no-cache add libstdc++ openssl libressl-dev ca-certificates && \
apk --no-cache add --virtual builddeps g++ gfortran musl-dev lapack-dev gcc make && \
pip install -r requirements.txt && \
apk del builddeps && \
rm -rf /root/.cache

# Copies Everything
COPY ./ ./

#--log-level=info --log-file=./logs/gunicorn.log --access-logfile=./logs/gunicorn-access.log
CMD gunicorn -w 4 -b 0.0.0.0:${PORT} wsgi:app
29 changes: 29 additions & 0 deletions deploy/base.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM python:3.6-alpine3.8

LABEL MAINTAINER="Liad Magen, [email protected]"

ENV CFLAGS="-fPIC"

WORKDIR /usr/local/include

RUN apk --no-cache add lapack && \
apk --no-cache add --virtual builddeps g++ gfortran musl-dev lapack-dev gcc make && \
# musl-dev python3-dev openblas-dev && \
\
wget https://mupdf.com/downloads/archive/mupdf-1.13.0-source.tar.gz -O - | tar -xz && \
mv mupdf-1.13.0-source mupdf && \
cd mupdf && \
make HAVE_X11=no HAVE_GLFW=no HAVE_GLUT=no prefix=/usr/local && \
make HAVE_X11=no HAVE_GLFW=no HAVE_GLUT=no prefix=/usr/local install && \
mv /usr/local/include/mupdf/thirdparty /usr/local/thirdparty

WORKDIR /opt/app

RUN pip install numpy==1.15.4 && \
pip install scipy==1.1.0 && \
pip install scikit-learn==0.20 && \
pip install pandas==0.23.4 && \
pip install -U spacy==2.0.17.dev1 && \
python -m spacy download en && \
apk del builddeps && \
rm -rf /root/.cache
12 changes: 12 additions & 0 deletions deploy/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '3'
services:
engine:
build:
context: ../
dockerfile: deploy/Dockerfile
image: keep-current/web-miner
tty: true
ports:
- "5000:5000"
environment:
- "PORT=5000"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"""Testing the REST interface
"""
Empty file added webminer/use_cases/__init__.py
Empty file.

0 comments on commit 0c8d2d1

Please sign in to comment.