diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..68ee3ca --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +FROM debian:latest +MAINTAINER Jean Baptiste Favre + + +ENV SHELL "/bin/bash" +ENV DEBIAN_FRONTEND noninteractive +ENV TERM 1 + +ADD scripts/debian_cleaner.sh /tmp/ + +RUN /usr/bin/apt-get update -yqq \ + && /usr/bin/apt-get upgrade --no-install-recommends -yqq \ + && /usr/bin/apt-get install --no-install-recommends -yqq curl ca-certificates \ + nginx php5-fpm php5-apcu php5-curl php5-gd php5-sqlite \ + && /usr/bin/chsh -s /bin/bash root \ + && /bin/rm /bin/sh && ln -s /bin/bash /bin/sh \ + && /usr/sbin/groupadd -r selfoss \ + && /usr/sbin/useradd -r -m -s /bin/bash -g selfoss sefloss \ + && /usr/bin/curl -o /tmp/selfoss.tar.gz https://github.com/SSilence/selfoss/archive/2.15.tar.gz \ + && /bin/su - dataiku -c '/bin/tar xzf /tmp/selfoss.tar.gz -C /home/selfoss --strip-components=1' \ + && /bin/rm /tmp/selfoss.tar.gz \ + && /bin/mkdir /var/lib/selfoss \ + && /bin/chown -R selfoss: /var/lib/selfoss \ + && /bin/bash /tmp/debian_cleaner.sh + +VOLUME /var/lib/selfoss +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] +ADD ./docker-entrypoint.sh /usr/local/bin + +EXPOSE 80 diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100644 index 0000000..f31f14b --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -e + +SELFOSSDATA=/var/lib/selfoss +SELFOSSPROG=/home/selfoss + +function setup_selfoss() { +} + +trap "shut_down" SIGKILL SIGTERM SIGHUP SIGINT EXIT + +/bin/chown selfoss:selfoss ${SELFOSSDATA} + +/bin/bash diff --git a/scripts/debian_cleaner.sh b/scripts/debian_cleaner.sh new file mode 100644 index 0000000..126ee42 --- /dev/null +++ b/scripts/debian_cleaner.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +for FILE in $(ls -1d /usr/share/locale/*|grep -v en);do rm -rf $FILE;done +for FILE in $(ls -1R /usr/share/i18n/locales/* | grep -v en_GB | grep -v en_US);do rm -rf $FILE;done +find /usr/share/doc -type f -exec rm -f {} \; +find /usr/share/man -type f -exec rm -f {} \; +/usr/bin/apt-get -y autoremove +/usr/bin/apt-get clean +/bin/rm -rf /var/lib/apt/lists/* +/bin/rm -f /var/lib/dpkg/info/* +/bin/rm -f /var/cache/debconf/* +/bin/rm -rf /tmp/*