Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for docker #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM rust AS builder

WORKDIR /src
COPY . .
RUN chown -R 1000:1000 /src

RUN cargo build --release

FROM archlinux

RUN pacman -Syu --noconfirm \
texlive-basic \
texlive-latexrecommended \
texlive-latexextra \
texlive-fontsextra

RUN pacman -S --noconfirm inotify-tools

COPY --from=builder /src/target/release/curriculust /usr/bin/curriculust
COPY --from=builder /src/build.sh /usr/bin/curriculust-watch
RUN sed -i 's#cargo run --#/usr/bin/curriculust#' /usr/bin/curriculust-watch
RUN sed -i 's#"./src/" "./resume_cv_proc_macro"##' /usr/bin/curriculust-watch

WORKDIR /src
RUN useradd -u 1000 user -M -d /src
RUN chown -R 1000:1000 /src
USER 1000:1000
ENTRYPOINT ["/usr/bin/curriculust-watch"]
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,21 @@ Internally `build.sh` calls:

For example, to build the example in the `example/` folder with the Developer CV template, the command would be `./build.sh ./example/base.yml ./build/example.tex ./template/developercv.cls`.

## Dockerfile usage

Docker is supported through the provided Dockerfile. It packages the main `curricust` binary and the `build.sh` script (slightly patched for docker support) under `curricust-watch`. The default entrypoint is `curricust-watch` but can be changed using the `--entrypoint` flag for docker.
The container workdir is under /src, so just mount your cv source files unders /src and you can reference them directly.
Practical example:
```sh
git clone https://github.com/Stypox/curricust
cd curricust
docker build . -t curricust:latest
# this is clunky, but important, see the note below.
mkdir out
docker run --rm -it -v "$PWD/example:/src" -v "$PWD/template/:/src/template" curricust base.yml out/out.pdf template/developercv.cls --watch
```
**Note: docker support it's very limited at the current stage. It is not guaranteed to work out of the box.**


## Templates

Expand Down