4 ms·
Running Mod_Perl with Mojolicious in Docker
- davidw 3y agoI would definitely label this Docker image something like Party_like_its_1999
- serallak 3y agoActually this setup uses Plack, a framework whose first version was released in 2009.
- citrin_ru 3y agoWhat are the reasons to use mod_perl in 2023? Plack FastCGI behind nginx looks like a better option.
- rawleyfowler 3y agoArticle writer here. A lot of our CI/CD is designed around mod_perl, and in-place updates. We run NewRelic configured to monitor Apache, which stops us from having to roll our own NewRelic connection through a CPAN module that we'd have to audit. In general for our needs, I actually believe mod_perl is superior to (F)CGI or a PSGI server reverse proxy.
- xrd 3y agoI'm really interested in what you are building at your company.
- ktpsns 3y agoMod_perl was really tied into Apache. You could basically script the web server internals at a completely different level then (f)CGI and friends. In contrast, (f)CGI emphasizes a clean interface between different (os) processes. Both has its reasons to exist.
- oalders 3y agoIt was a good year!
- KronisLV 3y agoSome thoughts on the ordering of instructions in the Dockerfile: FROM motemen/mod_perl:5.36.0-2.4.58-2.0.13 # Run apt first, so layers can be reused if the image is built often, do not include package lists RUN apt-get update -y && apt-get install -y wget make build-essential \ && rm -rf /var/lib/apt/lists/* # Installing modules/packages might also be done in the beginning (as long as they don't need other files in place) # If you ever need something like package.json/pom.xml/Gemfile/requirements.txt etc., COPY those first) RUN cpan -iT Plack Mojolicious # Bigger dependencies that change less frequently can go first, for caching COPY lib /usr/local/apache2/lib # The rest of the configuration and app files COPY app.psgi /app.psgi COPY httpd.conf /usr/local/apache2/conf/httpd.conf COPY mojolicious.conf /usr/local/apache2/conf/mojolicious.conf EXPOSE 80 CMD ["httpd-foreground"] From: https://docs.docker.com/build/cache/ https://docs.docker.com/build/cache/ (probably not super important unless you're doing a lot of stuff, but sometimes useful)
- oalders 3y agoVery helpful. I tend to re-run "docker build" a lot when I'm figuring stuff out. In those cases ordering can make a big difference.