diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2dc6d43 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +FROM perl:5.36 + +# Move it +WORKDIR /opt +COPY assets/ ./assets/ +COPY lib/ ./lib/ +COPY migrations/ ./migrations/ +COPY public/ ./public/ +COPY t/ ./t/ +COPY templates/ ./templates/ +COPY script/ ./script/ +COPY cpanfile . +COPY post_text.conf . + +# 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", "script/post_text", "prefork", "-m", "production"] diff --git a/README.md b/README.md index 828dbbd..47abcfe 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,32 @@ Run the tests locally (against development environment): prove -l +## Building/running container + +### Build + + podman build -t post_text . + +### Tag + + podman tag post_text git.n4vn33t.com/swag/post_text + +### Push + + podman push git.n4vn33t.com/swag/post_text + +### Pull + + podman pull git.n4vn33t.com/swag/post_text + +### Run + + podman run -dt --rm --name post_text -p 3002:3000 post_text:latest + +### Generate unit file + + podman generate systemd --files --new --name post_text + ## TODOs 1. Rules/about page diff --git a/assets/assetpack.db b/assets/assetpack.db index f3368a8..0132ec5 100644 --- a/assets/assetpack.db +++ b/assets/assetpack.db @@ -1,5 +1,5 @@ [css-min:css/PostText.css] -checksum=942e7be1d2 +checksum=3698d7bf52 format=css minified=1 [css-min:https://unpkg.com/98.css] diff --git a/cpanfile b/cpanfile index b936369..6c42fd5 100644 --- a/cpanfile +++ b/cpanfile @@ -7,3 +7,4 @@ requires 'Crypt::Passphrase::Bcrypt'; # Needed for old passphrases requires 'Perl::Critic::Community'; requires 'Date::Format'; requires 'XML::RSS'; +requires 'CSS::Minifier::XS';