regebro / hovercraft

Make dynamic impressive presentations from text files!
https://hovercraft.readthedocs.org
MIT License
1.49k stars 209 forks source link

Dockerfile #186

Closed Timoses closed 5 years ago

Timoses commented 5 years ago

There is a Docker-Hovercraft repo (automated build to the docker hub registry). The "latest" version used there is 2.4. It's not ideal to have the Dockerfile in a separate repo as automatic building is not triggered there when the actual hovercraft repo is updated. The problem is, that for each hovercraft! release the Dockerfile on https://github.com/phpcommunity/docker-hovercraft/ would require an update.. At least this is how I presume docker automatic build does work (I never used it myself). It would be more useful if the Dockerfile was actually provided within this repository and bound to automatically build an image and publish it to docker hub from here.

If the Dockerfile resided here the docker image could be automatically built and uploaded to docker hub.

I'm not certain if it would be possible to reflect the master branch. I assume the upload of a python app to pip is done manually? Alternatively the Dockerfile could be written to directly build the app into the image. Something along the lines (not a perfect example):

FROM python:3-alpine

RUN apk add --no-cache --virtual .build build-base \
    libxml2-dev libxslt-dev

COPY * /source/

WORKDIR /source

RUN python setup.py install \
    && mkdir /presentation

WORKDIR /presentation

EXPOSE 9000

ENTRYPOINT ["hovercraft", "--port", "0.0.0.0:9000"]

CMD ["/presentation"]

However, this lead me to a ~280MB image instead of the nice ~75MB with pip install.. A multi-stage build with a distroless image could make it much smaller. However, I'm not at all familiar with python, so I'm really uncertain which files are required. And I wouldn't want to recommend using Bazel..

I'm uncertain whether it would be possibile to use the phpcommunity hovercraft docker repo for this.

Perhaps @ramsey can state his opinion.

ramsey commented 5 years ago

The phpcommunity/hovercraft Docker image is not an official image. It's an automated build in the sense that, whenever a change is pushed to the https://github.com/phpcommunity/docker-hovercraft/ repo, it will trigger a build of a new image on Docker Hub. It is not intended to be synchronized with the official Hovercraft project. :smile:

regebro commented 5 years ago

I will not support Docker, sorry.

Lockszmith-GH commented 2 years ago

I apologize to necromance this issue, but I was wondering, 4 years later if your position on this has changed. And if not (which is completely ok), if you know of a well maintained docker implementation that you repeatedly encounter others are using?

regebro commented 2 years ago

No, I haven't encountered anyone using Docker for this outside this issue, and have to admit that I'm slightly mystified as to why you would launch a whole docker image just to run Hovercraft.

ramsey commented 2 years ago

The use-case I had was for environments with outdated Python and pip, machines where I didn’t want to go through the process to set up a virtualenv each time, or projects where I was working with others, and we wanted to ensure we were always running the same version/environment of Hovercraft.

regebro commented 2 years ago

I'm happy to link to someone that will keep a docker environment including Hovercraft up to date, but I can't do it myself, and I don't think it should be in this repository.

Lockszmith-GH commented 2 years ago

I see. I revisit hovercraft every few months, testing it out. Usually after having a brand new environment, I don't use python, so testing hovercraft is this chore that repeats. I'm ashamed to say, I'm not totally hooked on Markdown as a presentation platform, but out of most of the projects, yours is the one that I find the most interesting / flexible.

I created a successful Dockerfile and docker-compose.yaml but maintaining it long term on a separate place doesn't seem too effective.

I am more than willing to help maintain it here as part of your project, addressing any issues that arise.

Note - I'm not talking about maintaining a docker image in a registry, just the Dockerfile and docker-compose.yaml files for local consumption.

These are in no way complex, and the instructions are quite simple. If you're interested, I'll be happy to open a PR for that.