www2.0/Dockerfile
swagg boi 34f8331365 Security-related changes
I've added `apt-get -y upgrade` to the Dockerfile to ensure the latest security patches for Debian are pulled into the container and I've also hard-coded in the file extension for the CGI scripts/plugin due to some security vulnerability that's been patched in Mojolicious v9.11+ (probably should've been done this way in the first place)
2021-03-24 14:54:38 -04:00

38 lines
920 B
Docker

FROM perl:5.32
# Dependency time
RUN apt-get update
RUN apt-get -y upgrade
RUN apt-get -y install fortune-mod ruby
RUN cpanm CGI
RUN cpanm CGI::Carp
RUN cpanm Mojolicious
RUN cpanm Mojolicious::Plugin::CGI
RUN cpanm Number::Format
RUN cpanm Regexp::Common
# Version 0.106 of Getopt::Long::Descriptive won't build for me; as
# it's just a dependency for WebService::Mattermost anyways let's just
# go with 0.105 since we know that works
RUN cpanm RJBS/Getopt-Long-Descriptive-0.105.tar.gz
RUN cpanm WebService::Mattermost
RUN cpanm XML::LibXML
RUN gem install cgi
RUN gem install ipaddress
# Move it
WORKDIR /opt
COPY cgi-bin/ ./cgi-bin/
COPY public/ ./public/
COPY templates/ ./templates/
COPY .mmCreds.xml .
COPY .msg.bans .
COPY .name.bans .
COPY www-swagg.conf .
COPY www-swagg.pl .
# Finish setting up the environment
ENV MOJO_REVERSE_PROXY=1
# Send it
CMD ["perl", "www-swagg.pl", "daemon", "-m", "production"]