30 lines
758 B
Docker
30 lines
758 B
Docker
FROM ubuntu
|
|
|
|
RUN useradd -d /app app
|
|
RUN apt-get update && \
|
|
apt-get -y install python \
|
|
python-dev \
|
|
python-pip \
|
|
libpq-dev \
|
|
uwsgi \
|
|
uwsgi-plugin-python \
|
|
git
|
|
|
|
# We use that to cache last requirements version
|
|
COPY requirements.txt /app/requirements.txt
|
|
RUN pip install -r /app/requirements.txt
|
|
|
|
RUN apt-get -y install python-psycopg2
|
|
|
|
WORKDIR /app
|
|
|
|
EXPOSE 8000
|
|
USER app
|
|
|
|
ENV PYTHONUNBUFFERED 1
|
|
|
|
CMD ./manage.py db upgrade && \
|
|
uwsgi --http-socket :8000 --processes 4 --master --plugin python \
|
|
--pythonpath /app --module flaskbase.wsgi:application \
|
|
--touch-reload '/app/flaskbase/wsgi.py'
|