forked from there4/markdown-resume
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (26 loc) · 1.05 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
# Utilize multi-stage build to keep image size down
FROM composer as composer
COPY composer.* ./
RUN composer install --no-dev --optimize-autoloader --no-progress --no-suggest
# Build the actual image
FROM php
WORKDIR /resume
CMD ["/bin/bash"]
RUN apt-get update \
&& apt-get install -qqy --no-install-recommends\
# This is for enabling the program to be run with watch
procps \
wkhtmltopdf \
# Required to run PDF generation
xvfb \
xauth \
&& rm -rf /var/lib/apt/lists/*
# Wrap pdf creation in a xvfb-run to enable headless pdf creation in the container
RUN printf '#!/bin/bash\nxvfb-run md2resume pdf "$@"' >> /usr/bin/md2pdf \
&& chmod +x /usr/bin/md2pdf
# Enables continously calling a command and piping the output to STDOUT, viewable via docker logs
RUN printf '#!/bin/bash\nwhile sleep 1; do\n "$@"\ndone' >> /usr/bin/watch-docker \
&& chmod +x /usr/bin/watch-docker
COPY --from=composer /app/vendor /app/vendor
COPY . /app
RUN ln -s /app/bin/md2resume /usr/bin/md2resume