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

Dockerfile for scholia server #691

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions .dockerignore
@@ -0,0 +1,8 @@
# Python generated files
**/*.pyc
**/__pycache__

# directories
build
dist
scholia.egg-info
24 changes: 24 additions & 0 deletions Dockerfile
@@ -0,0 +1,24 @@
FROM python:3.5-slim

LABEL version="1.0"
LABEL description="This container starts the scholia server."

# setup working directory
WORKDIR /project

# install dependencies
RUN pip install wheel
RUN pip install waitress

COPY requirements.txt /project
RUN pip install -r requirements.txt

# import scholia project
COPY . .

# build and install scholia
RUN python setup.py bdist_wheel

# run production server
EXPOSE 8080
ENTRYPOINT [ "waitress-serve", "--call", "scholia.app:create_app" ]
4 changes: 3 additions & 1 deletion scholia/app/__init__.py
Expand Up @@ -31,7 +31,7 @@ def create_app(text_to_topic_q_text_enabled=True, third_parties_enabled=False):
Flask app object.

"""
app = Flask(__name__)
app = Flask(__name__, instance_relative_config=True)

Bootstrap(app)

Expand All @@ -48,4 +48,6 @@ def create_app(text_to_topic_q_text_enabled=True, third_parties_enabled=False):

app.third_parties_enabled = third_parties_enabled

app.config.from_pyfile('flask.cfg', silent=True)

return app