-
Notifications
You must be signed in to change notification settings - Fork 440
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,45 @@ | ||
FROM debian:jessie | ||
|
||
RUN apt-get update && apt-get install -y python3 git python3-pip \ | ||
libxml2-dev libxslt1-dev python-dev python-virtualenv locales libffi-dev \ | ||
build-essential python3-dev zlib1g-dev libssl-dev gettext \ | ||
libpq-dev libmysqlclient-dev libmemcached-dev libjpeg-dev \ | ||
aqbanking-tools supervisor nginx sudo \ | ||
--no-install-recommends | ||
|
||
WORKDIR / | ||
|
||
RUN dpkg-reconfigure locales && \ | ||
RUN apt-get update && \ | ||
apt-get install -y python3 git python3-pip \ | ||
libxml2-dev libxslt1-dev python-dev python-virtualenv locales libffi-dev \ | ||
build-essential python3-dev zlib1g-dev libssl-dev gettext \ | ||
libpq-dev libmysqlclient-dev libmemcached-dev libjpeg-dev \ | ||
aqbanking-tools supervisor nginx sudo \ | ||
--no-install-recommends && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
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/* | ||
|
||
RUN useradd -ms /bin/bash -d /pretix -u 15371 pretixuser | ||
RUN echo 'pretixuser ALL=(ALL) NOPASSWD: /usr/bin/supervisord' >> /etc/sudoers | ||
/usr/sbin/update-locale LANG=C.UTF-8 && \ | ||
mkdir /etc/pretix && \ | ||
mkdir /data && \ | ||
useradd -ms /bin/bash -d /pretix -u 15371 pretixuser && \ | ||
echo 'pretixuser ALL=(ALL) NOPASSWD: /usr/bin/supervisord' >> /etc/sudoers && \ | ||
mkdir /static | ||
|
||
RUN mkdir /etc/pretix | ||
RUN mkdir /data | ||
VOLUME /etc/pretix | ||
ENV LC_ALL=C.UTF-8 \ | ||
DJANGO_SETTINGS_MODULE=production_settings | ||
|
||
COPY deployment/docker/pretix.bash /usr/local/bin/pretix | ||
RUN chmod +x /usr/local/bin/pretix | ||
COPY deployment/docker/supervisord.conf /etc/supervisord.conf | ||
|
||
COPY deployment/docker/nginx.conf /etc/nginx/nginx.conf | ||
RUN rm /etc/nginx/sites-enabled/default | ||
|
||
COPY deployment/docker/production_settings.py /pretix/src/production_settings.py | ||
COPY src /pretix/src | ||
WORKDIR /pretix/src | ||
ADD deployment/docker/production_settings.py /pretix/src/production_settings.py | ||
ENV DJANGO_SETTINGS_MODULE production_settings | ||
|
||
RUN pip3 install -U pip wheel setuptools | ||
RUN pip3 install -r requirements.txt -r requirements/mysql.txt -r requirements/postgres.txt \ | ||
-r requirements/memcached.txt -r requirements/redis.txt \ | ||
-r requirements/py34.txt gunicorn | ||
RUN chmod +x /usr/local/bin/pretix && \ | ||
rm /etc/nginx/sites-enabled/default && \ | ||
pip3 install -U pip wheel setuptools && \ | ||
cd /pretix/src && \ | ||
pip3 install -r requirements.txt -r requirements/mysql.txt -r requirements/postgres.txt \ | ||
-r requirements/memcached.txt -r requirements/redis.txt \ | ||
-r requirements/py34.txt gunicorn && \ | ||
mkdir -p data && \ | ||
chown -R pretixuser:pretixuser /static /pretix /data data && \ | ||
sudo -u pretixuser make production | ||
|
||
RUN mkdir /static && chown -R pretixuser:pretixuser /static /pretix /data | ||
USER pretixuser | ||
RUN make production | ||
|
||
VOLUME ["/etc/pretix", "/data"] | ||
EXPOSE 80 | ||
|
||
ENTRYPOINT ["pretix"] | ||
CMD ["all"] |