2018-03-14 16:51:38 -04:00
|
|
|
# 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
|
|
|
|
|
2018-04-14 05:17:40 -04:00
|
|
|
WORKDIR /resume
|
|
|
|
CMD ["/bin/bash"]
|
|
|
|
|
2018-03-14 16:51:38 -04:00
|
|
|
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/*
|
|
|
|
|
2018-04-14 05:17:40 -04:00
|
|
|
# Wrap pdf creation in a xvfb-run to enable headless pdf creation in the container
|
2018-08-07 08:55:32 -04:00
|
|
|
RUN echo "#!/bin/bash\nxvfb-run $(which wkhtmltopdf) \"\$@\"" >> /usr/local/bin/wkhtmltopdf \
|
|
|
|
&& chmod +x /usr/local/bin/wkhtmltopdf
|
2018-04-14 05:17:40 -04:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2018-03-14 16:51:38 -04:00
|
|
|
COPY --from=composer /app/vendor /app/vendor
|
|
|
|
COPY . /app
|
|
|
|
|
|
|
|
RUN ln -s /app/bin/md2resume /usr/bin/md2resume
|