-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
51 lines (38 loc) · 1.49 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
FROM ubuntu:focal
MAINTAINER Alexey Zankevich <[email protected]>
ENV LANG C.UTF-8
ENV LANGUAGE C.UTF-8
ENV LC_ALL C.UTF-8
ENV CONTAINER_TYPE teambot
ENV SUPERVISOR_CONFIG app.conf
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && \
apt install -y binutils \
curl \
postgresql-client \
python3-pip \
software-properties-common \
sudo \
supervisor \
uwsgi \
uwsgi-plugin-python3
# add ES repo and install filebeat
RUN curl https://packages.elasticsearch.org/GPG-KEY-elasticsearch | sudo apt-key add -
RUN echo "deb http://packages.elastic.co/beats/apt stable main" | sudo tee -a /etc/apt/sources.list.d/beats.list
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y filebeat
RUN mkdir -p /var/run/celerybeat/
VOLUME /var/run/celerybeat/
ENV DJANGO_SETTINGS_MODULE teambot.settings
# install python dependencies
ADD requirements.txt /home/docker/
# RUN pip2 install -U pip setuptools six==1.10.0
RUN pip3 install -r /home/docker/requirements.txt
# install project sources
ADD . /home/docker/code/
WORKDIR /home/docker/code/
RUN mkdir -p /var/log/teambot/
VOLUME /var/log/teambot/
# -: optimize
RUN python3 manage.py collectstatic -c --noinput
EXPOSE 80
CMD ["bash", "-c", "test -f /etc/supervisor/conf.d/$SUPERVISOR_CONFIG || ln -s /home/docker/code/ext_configs/supervisor/$SUPERVISOR_CONFIG /etc/supervisor/conf.d/ && supervisord -n" ]