Start Docker support [WIP]
[mygpo.git] / Dockerfile
blob720c4f2686bf915352f8546298ebde0fabb7378d
1 FROM ubuntu:14.04
2 MAINTAINER Stefan Kögl <stefan@skoegl.net>
4 # use bash instead of built-in sh, because it does not support "source" during build
5 RUN rm /bin/sh && ln -s /bin/bash /bin/sh
7 # install all packaged dependencies
8 RUN apt-get update && apt-get install -y \
9     git \
10     python2.7 \
11     python2.7-dev \
12     python-virtualenv \
13     libpq-dev \
14     libjpeg-dev \
15     zlib1g-dev \
16     libwebp-dev
18 # create log directories
19 RUN mkdir -p /var/log/gunicorn
21 # copy source
22 COPY . /srv/mygpo
23 WORKDIR /srv/mygpo
25 # run everything in a virtualenv
26 RUN virtualenv venv
27 RUN source venv/bin/activate
29 # install all runtime dependencies
30 RUN pip install \
31     -r /srv/mygpo/requirements.txt \
32     -r /srv/mygpo/requirements-setup.txt
34 # set up missing environment variables
35 ENTRYPOINT ["/srv/mygpo/bin/docker-env.sh"]
37 # default launch command
38 CMD ["gunicorn", "mygpo.wsgi:application", "--access-logfile", "-"]
40 # HTTP port
41 EXPOSE 8000