-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
58 lines (50 loc) · 1.48 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y \
postgresql \
postgresql-client \
libpq-dev \
python3 \
python3-pip \
python3-dev \
libffi-dev \
libjpeg-dev \
git \
nginx
RUN git clone https://github.com/cgwire/zou.git /opt/zou && \
git clone -b build https://github.com/cgwire/kitsu.git /opt/kitsu && \
cd /opt/zou && \
python3 setup.py install && \
pip3 install \
gunicorn \
gevent
COPY gunicorn /etc/zou/gunicorn.conf
COPY nginx /etc/nginx/sites-available/zou
RUN useradd --home /opt/zou zou && \
mkdir /opt/zou/logs && \
chown zou: /opt/zou/logs && \
chown -R zou:www-data /opt/kitsu && \
chown -R zou:www-data /opt/zou && \
rm /etc/nginx/sites-enabled/default && \
ln -s /etc/nginx/sites-available/zou /etc/nginx/sites-enabled
USER postgres
RUN service postgresql start && \
psql --command "create database zoudb;" -U postgres && \
psql --command "ALTER USER postgres WITH PASSWORD 'mysecretpassword';"
USER root
WORKDIR /opt/zou
# About Gunicorn and port 5000
# Gunicorn is being reverse-proxied through Nginx,
# which is ultimately the process serving port 80
ENTRYPOINT \
service nginx start && \
service postgresql start && \
echo Initialising Zou.. && \
sleep 5 && \
zou init_db && \
zou init_data && \
zou create_admin && \
echo Running Zou.. && \
gunicorn \
-c /etc/zou/gunicorn.conf \
-b 0.0.0.0:5000 \
wsgi:application