forked from jsykes/docker-taiga
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
75 lines (62 loc) · 2.43 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
FROM python:3.6-slim-stretch
ENV DEBIAN_FRONTEND noninteractive
RUN set -x; \
apt-get update \
&& apt-get install -y --no-install-recommends \
g++ \
libssl-dev \
git \
locales \
gettext \
ca-certificates \
nginx \
&& rm -rf /var/lib/apt/lists/*
# Setup locale settings
RUN locale-gen en_US.UTF-8 && dpkg-reconfigure locales
# specify LANG to ensure python installs locals properly
ENV LANG C
ENV LANG en_US.UTF-8
ENV LC_TYPE en_US.UTF-8
RUN locale-gen en_US.UTF-8 && locale -a
# Preparing Nginx data
COPY taiga-back /usr/src/taiga-back
COPY taiga-front-dist/ /usr/src/taiga-front-dist
COPY conf/locale.gen /etc/locale.gen
# Setup Nginx configurations
RUN rm /etc/nginx/sites-enabled/default
RUN sed -i "s/user www-data/user root/g" /etc/nginx/nginx.conf
RUN sed -i "s/worker_connections 768/worker_connections 1024/g" /etc/nginx/nginx.conf
COPY conf/nginx/sites-available/* /etc/nginx/sites-available/
COPY conf/nginx/snippets/* /etc/nginx/snippets/
# forward request and error logs to docker log collector
RUN ln -sf /dev/stdout /var/log/nginx/access.log
RUN ln -sf /dev/stderr /var/log/nginx/error.log
# Setup symbolic links for configuration files
RUN mkdir -p /taiga
COPY conf/taiga/local.py /taiga/local.py
COPY conf/taiga/docker.py /taiga/docker.py
COPY conf/taiga/conf.json /taiga/conf.json
RUN ln -s /taiga/local.py /usr/src/taiga-back/settings/local.py
RUN ln -s /taiga/docker.py /usr/src/taiga-back/settings/docker.py
RUN ln -s /taiga/conf.json /usr/src/taiga-front-dist/dist/conf.json
# Backwards compatibility
RUN mkdir -p /usr/src/taiga-front-dist/dist/js/
RUN ln -s /taiga/conf.json /usr/src/taiga-front-dist/dist/js/conf.json
WORKDIR /usr/src/taiga-back
RUN pip install --no-cache-dir -r requirements.txt
# Define default env vars
ENV TAIGA_SSL False
ENV TAIGA_SSL_BY_REVERSE_PROXY False
ENV TAIGA_ENABLE_EMAIL False
ENV TAIGA_HOSTNAME localhost
ENV TAIGA_SECRET_KEY "!!!REPLACE-ME-j1598u1J^U*(y251u98u51u5981urf98u2o5uvoiiuzhlit3)!!!"
EXPOSE 80 443
VOLUME /usr/src/taiga-back/media
# Health checks
HEALTHCHECK CMD curl --fail http://localhost/conf.json || exit 1
HEALTHCHECK CMD curl --fail http://localhost/api/v1/ || exit 1
HEALTHCHECK CMD curl --fail http://localhost || exit 1
COPY checkdb.py /checkdb.py
COPY docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["gunicorn", "-w 3", "-t 60", "--pythonpath=.", "-b 127.0.0.1:8000", "taiga.wsgi"]