Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

switch to gunicorn #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# See https://www.digitalocean.com/community/tutorials/how-to-build-and-deploy-a-flask-application-using-docker-on-ubuntu-18-04
FROM tiangolo/uwsgi-nginx-flask:python3.7
FROM tiangolo/meinheld-gunicorn-flask:python3.7

ARG AIIDA_VERSION=1.2.1
ARG AIIDA_VERSION=1.3.1

# Install AiiDA
RUN pip install aiida-core[rest,atomic_tools]==$AIIDA_VERSION
RUN reentry scan -r aiida

# Scripts for REST API
COPY main.py /app
COPY uwsgi.ini /app

# Container vars
ENV AIIDA_PATH /app
Expand All @@ -25,5 +24,8 @@ ENV AIIDADB_PASS ""
ENV AIIDADB_BACKEND django
ENV default_user_email info@materialscloud.org

# start AiiDA REST API
EXPOSE 5000
# GUNICORN vars
# Set number of gunicorn workers to 2 (overriding automatic scaling with #cores)
# Note: memory footprint of the container scales linearly with the number of workers
# https://github.com/tiangolo/meinheld-gunicorn-flask-docker#advanced-usage
ENV WEB_CONCURRENCY 2