forked from thumbor/thumbor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
52 lines (44 loc) · 1.32 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
FROM python:3.8
VOLUME /data
# base OS packages
RUN apt-get update && \
apt-get -y upgrade && \
apt-get -y autoremove && \
apt-get install -y -q \
git \
curl \
libjpeg-turbo-progs \
graphicsmagick \
libgraphicsmagick++3 \
libgraphicsmagick++1-dev \
libgraphicsmagick-q16-3 \
zlib1g-dev \
libboost-python-dev \
gifsicle \
ffmpeg && \
apt-get clean
ENV HOME /app
ENV SHELL bash
ENV WORKON_HOME /app
WORKDIR /app
RUN mkdir -p /etc/circus.d /data
ADD docker/conf/circus.ini /etc/
COPY docker/conf/thumbor.conf.tpl /app/thumbor.conf.tpl
ADD docker/conf/thumbor-circus.ini.tpl /etc/circus.d/
COPY docker/requirements.txt /app/requirements.txt
ADD ./ /opt/thumbor
RUN chown www-data -R /etc/circus.d /app /data && \
cd /opt/thumbor && \
python3 setup.py build && \
python3 setup.py install && \
cd /app && \
cp /opt/thumbor/thumbor/cache/prune_cache.py /app/prune_cache.py && \
rm -R /opt/thumbor && \
pip3 install --trusted-host None --no-cache-dir -r /app/requirements.txt
COPY docker/docker-entrypoint.sh /
USER www-data
ENTRYPOINT ["/docker-entrypoint.sh"]
# running thumbor multiprocess via circus by default
# to override and run thumbor solo, set THUMBOR_NUM_PROCESSES=1 or unset it
CMD ["circus"]
EXPOSE 80 8888