diff --git a/README.rst b/README.rst index 3b71f40..422bca8 100644 --- a/README.rst +++ b/README.rst @@ -178,3 +178,36 @@ and deployed automatically when making a tagged released. To do so you need to: After merging to master, the workflow creates the tag and Github release for this version and uploads its wheel file to Pypi. + + +Docker +====== + +Cvcreator can also be run in a docker container. To build the container image, +run the following command from the repository root: + +.. code:: bash + + docker build -t cvcreator . + +Example usage of running cvcreator in the docker container: + +.. code:: bash + + docker run --rm -v $(pwd):/data cvcreator create /data/example.toml /data/my_cv.pdf + +This will mount the current working directory into the container at /data, and +run the cvcreator command to create a CV from example.toml to my_cv.pdf. + +If you want it even simpler (and always have to stand in the directory where your files are located), +you can create an alias in your shell configuration file like this: + +.. code:: bash + + alias cvcreator='docker run --rm -v $(pwd):/data cvcreator' + +Then you can run cvcreator commands as if it was installed on your system, e.g.: + +.. code:: bash + + cvcreator create /data/example.toml /data/my_cv.pdf \ No newline at end of file diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..9c064cb --- /dev/null +++ b/dockerfile @@ -0,0 +1,34 @@ +# Start with a minimal TeX Live image as base and install other +# necessary packages separately to keep the image size small. +FROM texlive/texlive:latest-small + +# Install additional TeX Live collections for language support +RUN tlmgr update --self && \ + tlmgr install collection-langeuropean && \ + tlmgr install changepage enumitem multirow titlesec + +# Install Python and curl for uv installation +RUN apt-get update && \ + apt-get install -y python3 python3-pip curl && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Install uv (Because it is the best --- Fight me!) +RUN curl -LsSf https://astral.sh/uv/install.sh | sh +ENV PATH="/root/.local/bin:$PATH" + +# Set working directory +WORKDIR /app + +# Copy project files +COPY pyproject.toml README.rst ./ +COPY cvcreator ./cvcreator + +# Create virtual environment and install project with dev dependencies +RUN uv venv /opt/venv +ENV PATH="/opt/venv/bin:$PATH" +RUN uv pip install -e ".[dev]" + +# Set the entrypoint to the cv command +ENTRYPOINT ["/opt/venv/bin/cv"] +