forked from gadiener/docker-pdfy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
45 lines (33 loc) · 1 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
FROM python:2-alpine
RUN apk update && \
apk --no-cache add tini gcc musl-dev
RUN addgroup -g 82 -S www-data \
&& adduser -u 82 -D -S -G www-data www-data
# CPDF
COPY ./cpdf.tar.gz /app/cpdf.tar.gz
RUN tar xzvf /app/cpdf.tar.gz -C /usr/bin/
# PhantomJS
COPY ./phantomjs.tar.gz /app/phantomjs.tar.gz
RUN tar xzvf /app/phantomjs.tar.gz -C /tmp/ && \
cp -R /tmp/etc/fonts /etc/ && \
cp -R /tmp/lib/* /lib/ && \
cp -R /tmp/lib64 / && \
cp -R /tmp/usr/lib/* /usr/lib/ && \
cp -R /tmp/usr/lib/x86_64-linux-gnu /usr/ && \
cp -R /tmp/usr/share/* /usr/share/ && \
cp /tmp/usr/local/bin/phantomjs /usr/bin/
RUN rm -rf /app/cpdf.tar.gz /app/phantomjs.tar.gz /tmp/*
RUN mkdir -p /storage
COPY ./requirements.txt /app/requirements.txt
COPY ./setup.py /app/setup.py
COPY ./src /app/src
RUN chown -R www-data:www-data /usr/local/ /app /storage
USER www-data
RUN cd /app && \
pip install -r requirements.txt && \
pip install .
EXPOSE 8080
WORKDIR /app
VOLUME /storage
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["pdfy"]