FROM registry.fedoraproject.org/fedora:41 as base
FROM base as build
RUN dnf -y install hugo
COPY <your templates directory or w/e here> /blog
COPY content /blog/content
WORKDIR /blog
RUN hugo
FROM base
RUN dnf -y install httpd
COPY --from=build /blog/public /var/www/html
ENTRYPOINT ["httpd"]
CMD ["-D", "FOREGROUND"]oh if you change registry.fedoraproject.org/fedora:41 to registry.access.redhat.com/ubi9/ubi:latest and install hugo by curling the release from github instead of a DNF install (I don’t think it’s in the RHEL repos), you can use RHEL in the container too…
-
the reasons this should definitely be containerized btw:
- easier to move between your desktop and this VPN’d server
- you don’t need such a crazy script with so many lines that are fragile and prone to error
- you don’t need to think about things getting left around because the only things in the container are the ones in your working directory, since it’s built from scratch every time
- easier to handle and understand updates between httpd and hugo and whatnot
- removes a lot of the complexity in how you have it set up from “that one server you SSH’d to” to a more declarative system that’s portable
-
everything about your scripts looks fragile as hell - containers, if you know what the hell you’re doing, give you a repeatable and portable way to describe a process
-
so barely being able to get them to run is probably a problem you should overcome, which will take some understanding of what it is you’re doing even outside the container today