From 3b6927ecfb22f6955fcc918d815378dfbfeb1db8 Mon Sep 17 00:00:00 2001 From: swag Date: Thu, 30 Dec 2021 20:52:34 -0500 Subject: [PATCH] Implement Dockerfile --- Dockerfile | 28 ++++++++++++++++++++++++++++ README.md | 7 ++++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..241a779 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +FROM perl:5.34 + +# Move it +WORKDIR /opt +COPY assets/ ./assets/ +COPY lib/ ./lib/ +COPY migrations/ ./migrations/ +COPY public/ ./public/ +COPY t/ ./t/ +COPY templates/ ./templates/ +COPY cpanfile . +COPY guestbook-ng.conf . +COPY guestbook-ng.pl . + +# Dependency time +RUN apt-get update +RUN apt-get -y upgrade +RUN cpanm --installdeps . + +# Test it +RUN prove -l -v + +# Finish setting up the environment +ENV MOJO_REVERSE_PROXY=1 +EXPOSE 3000 + +# Send it +CMD ["perl", "guestbook-ng.pl", "prefork", "-m", "development"] diff --git a/README.md b/README.md index 494ea69..634c179 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,12 @@ Mojolicious blockchain technologies powered by AI. Add the `-v` option for more verbose output +## Docker + +### Build + + docker build -t guestbook-ng . + ## TODOs 1. Input validation @@ -48,5 +54,4 @@ Add the `-v` option for more verbose output 1. Flash error for CAPTCHA failures and what nots 1. Replace HTML tables with CSS grids(!!) 1. Add column to tag posts as spam or hidden -1. Dockerfile 1. Add homepage/URL field