Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@ FROM tutum/apache-php

ENV PIWIK_VERSION 2.12.1

RUN apt-get update && \
apt-get install -y rsync && \
apt-get clean
RUN rm -rf /app/*
RUN curl -L -O http://builds.piwik.org/piwik-${PIWIK_VERSION}.tar.gz && \
tar --strip 1 -xzf piwik-${PIWIK_VERSION}.tar.gz && \
rm piwik-${PIWIK_VERSION}.tar.gz
RUN chown -R www-data:www-data /app
RUN chmod a+w /app/config
RUN cp -r /app/config /app/config-orig

EXPOSE 80
VOLUME /app/config
ADD run.sh /run.sh
RUN chmod +x /run.sh
CMD ["/run.sh"]
8 changes: 8 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -x
set -e
[ -n "${CLEAN_CONFIG:-}" ] && rsync -a --delete /app/config-orig/ /app/config/
[ -f "/app/config/global.php" ] || rsync -a --delete /app/config-orig/ /app/config/
chown -R www-data:www-data /app/config
/etc/init.d/apache2 start
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the upstream image launches apache slightly differently:

https://github.com/tutumcloud/tutum-docker-php/blob/master/run.sh#L3-5

Instead of launching apache ourself, could we call their run script after doing our bit of configuration?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes in upstream run.sh script, they load environments ... like /etc/init.d/apache2 do that, and they start apache in foreground mode. I prefer used Ubuntu / Debian apache maintainer script and follow evolution made by this team.
And yes, we can start run.sh given by tutum team after initialization ... but tutum team is more little and less reactive than Debian and Ubuntu community :-D

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to replace the base image if you can recommend a better one.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, we can just change run script.

tail -F /var/log/apache2/*