misp-docker/web/Dockerfile

69 lines
2.0 KiB
Docker
Raw Normal View History

2020-01-09 04:25:25 +01:00
2021-03-05 12:24:49 +01:00
FROM ubuntu:latest
2020-10-21 13:47:56 +02:00
2018-06-20 12:55:34 +02:00
# Install core components
ENV DEBIAN_FRONTEND noninteractive
2021-03-05 15:34:37 +01:00
RUN apt-get update && \
apt-get dist-upgrade -y && apt-get autoremove -y && apt-get clean && \
apt-get install -y software-properties-common && \
apt-get install -y postfix && \
apt-get install -y mysql-client curl gcc git gnupg-agent \
make python openssl redis-server sudo vim zip locales
2021-03-05 15:40:49 +01:00
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
2021-03-05 15:34:37 +01:00
# Install script
2021-03-05 17:28:46 +01:00
COPY /tmp INSTALL_NODB.sh
RUN chmod +x /tmp/INSTALL_NODB.sh
2021-03-05 16:42:03 +01:00
USER www-data
2021-03-05 17:28:46 +01:00
RUN sh /tmp/INSTALL_NODB.sh
2020-10-21 13:47:56 +02:00
# Supervisord Setup
RUN ( \
echo '[supervisord]'; \
echo 'nodaemon = true'; \
echo ''; \
echo '[program:postfix]'; \
echo 'process_name = master'; \
echo 'directory = /etc/postfix'; \
echo 'command = /usr/sbin/postfix -c /etc/postfix start'; \
echo 'startsecs = 0'; \
echo 'autorestart = false'; \
echo ''; \
echo '[program:redis-server]'; \
echo 'command=redis-server /etc/redis/redis.conf'; \
echo ''; \
echo '[program:apache2]'; \
echo 'command=/bin/bash -c "source /etc/apache2/envvars && exec /usr/sbin/apache2 -D FOREGROUND"'; \
echo ''; \
echo '[program:resque]'; \
echo 'command=/bin/bash /var/www/MISP/app/Console/worker/start.sh'; \
echo 'user = www-data'; \
echo 'startsecs = 0'; \
echo 'autorestart = false'; \
echo ''; \
echo '[program:misp-modules]'; \
echo 'command=/bin/bash -c "misp-modules -s -l 127.0.0.1"'; \
echo 'user = www-data'; \
echo 'startsecs = 0'; \
echo 'autorestart = false'; \
) >> /etc/supervisor/conf.d/supervisord.conf
# Modify syslog configuration
RUN sed -i -E 's/^(\s*)system\(\);/\1unix-stream("\/dev\/log");/' /etc/syslog-ng/syslog-ng.conf
# Add run script
# Trigger to perform first boot operations
ADD run.sh /run.sh
RUN chmod 0755 /run.sh && touch /.firstboot.tmp
# Make a backup of /var/www/MISP to restore it to the local moint point at first boot
WORKDIR /var/www/MISP
RUN tar czpf /root/MISP.tgz .
VOLUME /var/www/MISP
EXPOSE 80
2018-06-20 12:55:34 +02:00
ENTRYPOINT ["/run.sh"]