Created
May 29, 2021 18:08
-
-
Save beaverden/e8e9dead457eeb224afd71d86b032b00 to your computer and use it in GitHub Desktop.
Sample dockerfile for jsonresume
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# syntax=docker/dockerfile:1 | |
FROM debian:buster as base0 | |
RUN apt update -y | |
RUN apt upgrade -y | |
RUN apt install chromium -y | |
RUN apt install npm -y | |
RUN npm update -g | |
FROM base0 as base | |
# Ugly workaround for M1 ARM64 | |
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 | |
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser | |
ENV RESUME_PUPPETEER_NO_SANDBOX=1 | |
RUN npm install -g resume-cli --unsafe-perm=true --allow-root | |
RUN npm install jsonresume-theme-even | |
RUN ln /usr/bin/chromium /usr/bin/chromium-browser | |
# Generate an initial resume.json | |
FROM base as init-base | |
WORKDIR /resume-init | |
RUN yes | resume init | |
FROM scratch as init | |
COPY --from=init-base /resume-init/resume.json resume.json | |
# Copy resume.json and build a pdf | |
FROM base as build-base | |
WORKDIR /resume | |
COPY ./resume.json . | |
RUN resume export resume.pdf | |
FROM scratch as build-pdf | |
COPY --from=build-base /resume/resume.pdf resume.pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment