First dockerfile attempt

This commit is contained in:
Raphael Michel
2015-05-15 17:00:56 +02:00
parent c6bff238ba
commit 59f8930785
5 changed files with 38 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
FROM debian:jessie
RUN apt-get update && apt-get install -y supervisor python3 git python3-pip \
libxml2-dev libxslt1-dev python-dev python-virtualenv locales libffi-dev \
build-essential python3-dev --no-install-recommends
RUN dpkg-reconfigure locales && \
locale-gen C.UTF-8 && \
/usr/sbin/update-locale LANG=C.UTF-8
ENV LC_ALL C.UTF-8
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ADD gunicorn_starter.bash /gunicorn_starter.bash
ADD src /src
WORKDIR /src
RUN pip3 install -r requirements.txt
RUN pip3 install gunicorn
EXPOSE 80
CMD ["/usr/bin/supervisord"]

View File

@@ -0,0 +1,2 @@
main:
tar ch --exclude=_static --exclude=htmlcov --exclude=db.sqlite3 . | docker build -t test -

View File

@@ -0,0 +1,7 @@
#!/bin/bash
cd /src
export DJANGO_SETTINGS_MODULE=pretix.settings
gunicorn \
-b '0.0.0.0:80' \
-w 3 --max-requests 1000 --max-requests-jitter 50 \
pretix.wsgi

View File

@@ -0,0 +1 @@
../../../src

View File

@@ -0,0 +1,5 @@
[supervisord]
nodaemon=true
[program:gunicorn]
command=/bin/bash gunicorn_starter.bash