Skip to content

Dockerfile and a wrapper script to mount template and output directories as volumes... #444

Open
@masavini

Description

@masavini

Hi,
the Dockerfile could look like this:

FROM python:3.9-alpine

ARG USER=copier
ARG GROUP=copier
ARG UID=1000
ARG GID=1000

RUN addgroup -g "${GID}" "${GROUP}" && \
    adduser -h /home/"${USER}" -u "${UID}" -G "${GROUP}" -s /bin/bash -D "${USER}"


RUN set -ex; \
    apk add --no-cache --virtual .build-deps \
        gcc \
        musl-dev; \
    apk add --no-cache \
        bash \
        git \
        py3-virtualenv;

USER "${USER}"

ENV PATH=/home/${USER}/.local/bin:$PATH


RUN set -ex; \
    python3 -m pip install --user pipx; \
    pipx install copier; \
    pipx install invoke; \
    pipx install pre-commit; \
    pipx ensurepath;


USER root
RUN set -ex; \
    apk del .build-deps;

USER "${USER}"

ENTRYPOINT ["copier"]

I already built it and performed a few tests, it works pretty good.

It would be also nice to have a wrapper script to parse arguments and automatically mount template and output directories as volumes...

What do you think about?

Metadata

Metadata

Assignees

Labels

enhancementgood first issueEasy things for newbieshacktoberfest-acceptedThis PR is a candidate to win a T-shirt if done while the Hacktoberfest is livehelp wantedThe issue is valid, but we need community contributions to fix it

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions