forked from level09/enferno
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
32 lines (20 loc) · 1.03 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM python:3.7.2-slim
MAINTAINER Nidal Alhariri "[email protected]"
RUN apt-get update -y && \
apt-get install -y python-pip python-dev apt-utils libjpeg62-turbo-dev libzip-dev libxml2-dev libssl-dev libffi-dev libxslt1-dev libncurses5-dev python-setuptools libpq-dev git
# We copy just the requirements.txt first to leverage Docker cache
COPY ./requirements.txt /app/requirements.txt
WORKDIR /app
RUN pip install -r requirements.txt
COPY . /app
ENV FLASK_APP=run.py
ENV C_FORCE_ROOT="true"
ENV SQLALCHEMY_DATABASE_URI="postgresql://enferno:verystrongpass@postgres/enferno"
ENV CELERY_BROKER_URL="redis://redis:verystrongpass@redis:6379/10"
ENV CELERY_RESULT_BACKEND="redis://redis:verystrongpass@redis:6379/11"
ENV SESSION_REDIS="redis://redis:verystrongpass@redis:6379/1"
RUN echo 'alias act="source env/bin/activate"' >> ~/.bashrc
RUN echo 'alias ee="export FLASK_APP=run.py && export FLASK_DEBUG=0"' >> ~/.bashrc
CMD [ "uwsgi", "--http", "0.0.0.0:5000", \
"--protocol", "uwsgi", \
"--wsgi", "run:app" ]