-
Notifications
You must be signed in to change notification settings - Fork 21
/
Dockerfile.worker
49 lines (44 loc) · 1.57 KB
/
Dockerfile.worker
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
FROM ubuntu:16.04
LABEL maintainer "[email protected]"
ENV PYTHONUNBUFFERED 1
RUN apt-get -y update && \
apt-get install -y software-properties-common python-software-properties && \
add-apt-repository -y ppa:jonathonf/ffmpeg-4 && \
apt-get install -y \
supervisor \
cron \
libmysqlclient-dev \
mysql-client \
python-dev \
libjpeg-dev \
libcurl4-openssl-dev \
curl \
run-one \
ffmpeg \
wget \
vim \
libpcre3 \
libpcre3-dev \
libssl-dev \
libffi-dev \
python-pip && \
rm -rf /var/lib/apt/lists/* && \
pip install -U 'pip==20.3.4' 'setuptools==44.0.0' distribute && \
# Fix for a really weird issue when installing postmark library
# distribute fails to run since it sees a setuptools with "0.7"
# in the name, even though ubuntu:16.04 has pre-installed "20.7.0"
# https://github.com/pypa/setuptools/issues/543
rm -rf /usr/lib/python2.7/dist-packages/setuptools-20.7.0.egg-info && \
groupadd ubuntu --gid=1010 && \
useradd ubuntu --create-home --home-dir=/home/ubuntu \
--uid=1010 --gid=1010 && \
mkdir -p /srv/mltshp.com/logs && \
chown -R ubuntu:ubuntu /srv/mltshp.com
COPY requirements.txt /tmp
RUN pip install -r /tmp/requirements.txt && rm /tmp/requirements.txt
COPY setup/production/supervisord-worker.conf /etc/supervisor/conf.d/mltshp.conf
# NOTE: /srv/mltshp.com/logs should be a mounted volume for this image
ADD . /srv/mltshp.com/mltshp
WORKDIR /srv/mltshp.com/mltshp
RUN crontab -u ubuntu setup/production/mltshp-worker--crontab
CMD ["/usr/bin/supervisord"]