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

Add Dependabot.yml and Docker Container Build and release workflow #7

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

8ear
Copy link

@8ear 8ear commented Oct 28, 2022

Hi,
I like your python tool very much. But I not so a big fan of installing python stuff all the time directly on my machine. Therefore I created a Dockerfile to create a docker container from your content and include directly a Github workflow so that the container is build automatically to the github repository.

Please check out the stuff.

Kind regards
Max

@thomaspatzke
Copy link
Member

Cool 👍 Thanks a lot for the contribution!

I see some further setup in the repo is required, I will do this when I find some time.

@sifex
Copy link
Collaborator

sifex commented Dec 3, 2022

@8ear would probably be better to build from source and use multi-stage to keep the file size down as much as possible

Here's one I was gonna submit but found your PR ☺️

FROM python:3-slim as poetry

ENV POETRY_HOME=/opt/poetry
ENV POETRY_VIRTUALENVS_IN_PROJECT=true
ENV PATH="$POETRY_HOME/bin:$PATH"
WORKDIR /app

# Install Poetry
RUN python -c 'from urllib.request import urlopen; print(urlopen("https://install.python-poetry.org").read().decode())' | python -

# Copy pyproject.toml
COPY pyproject.toml pyproject.toml
COPY poetry.lock poetry.lock

# Install packages
RUN pip3 install --upgrade pip
RUN poetry install --only main --no-interaction --no-ansi --no-root -vvv

# Install sigma-cli
COPY ./ ./
RUN rm -r .github/ .git/
RUN poetry install --only main --no-interaction --no-ansi -vvv

# Copy Artifacts to clean image
FROM python:3.11-alpine as runtime

WORKDIR /app
ENV PATH="/app/.venv/bin:$PATH"
ENV PYTHONPATH "${PYTHONPATH}:/app:/app/.venv/lib/python3.11/site-packages/"

# Copy sigma-cli over
COPY --from=poetry /app /app

ENTRYPOINT ["sigma"]
CMD ["--help"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants