Initial commit

This commit is contained in:
Jean Baptiste Favre 2016-06-27 22:45:06 +02:00
parent d07e2b2aba
commit 01163323c2
3 changed files with 56 additions and 0 deletions

30
Dockerfile Normal file
View File

@ -0,0 +1,30 @@
FROM debian:latest
MAINTAINER Jean Baptiste Favre <docker@jbfavre.org>
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

14
docker-entrypoint.sh Normal file
View File

@ -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

12
scripts/debian_cleaner.sh Normal file
View File

@ -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/*