Skip to content

Commit

Permalink
Simple entryscript to support 3 use-cases
Browse files Browse the repository at this point in the history
This entrypoint should support 3 use-cases:

1. Untouched docker image for apache (CMD is apache2-xxx)
2. Untouched docker image for php-fpm (CMD is php-fpm)
3. Extended version with custom CMD

The 2 first use-cases are handled by looking a the parameter (the CMD command).

The last one is defined by the user when extending the image. He must
know whether he extends the apache or the php-fpm image and define the
NEXTCLOUD_DOCKER_MODE value with either "apache" or "php-fpm"

This PR also removes the NEXTCLOUD_UPDATE=1 that was used to force the
script to run when the image had been extended.
  • Loading branch information
callmemagnus committed Dec 16, 2023
1 parent b808756 commit b9adcad
Show file tree
Hide file tree
Showing 8 changed files with 323 additions and 277 deletions.
2 changes: 1 addition & 1 deletion .examples/dockerfiles/cron/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ RUN apt-get update && apt-get install -y \

COPY supervisord.conf /

ENV NEXTCLOUD_UPDATE=1
ENV NEXTCLOUD_DOCKER_MODE=apache

CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]
2 changes: 1 addition & 1 deletion .examples/dockerfiles/cron/fpm-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ RUN apk add --no-cache supervisor \

COPY supervisord.conf /

ENV NEXTCLOUD_UPDATE=1
ENV NEXTCLOUD_DOCKER_MODE=php-fpm

CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]
2 changes: 1 addition & 1 deletion .examples/dockerfiles/cron/fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ RUN apt-get update && apt-get install -y \

COPY supervisord.conf /

ENV NEXTCLOUD_UPDATE=1
ENV NEXTCLOUD_DOCKER_MODE=php-fpm

CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]
2 changes: 1 addition & 1 deletion .examples/dockerfiles/full/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ RUN mkdir -p \

COPY supervisord.conf /

ENV NEXTCLOUD_UPDATE=1
ENV NEXTCLOUD_DOCKER_MODE=apache

CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]
2 changes: 1 addition & 1 deletion .examples/dockerfiles/full/fpm-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ RUN mkdir -p \

COPY supervisord.conf /

ENV NEXTCLOUD_UPDATE=1
ENV NEXTCLOUD_DOCKER_MODE=php-fpm

CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]
2 changes: 1 addition & 1 deletion .examples/dockerfiles/full/fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ RUN mkdir -p \

COPY supervisord.conf /

ENV NEXTCLOUD_UPDATE=1
ENV NEXTCLOUD_DOCKER_MODE=php-fpm

CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]
241 changes: 137 additions & 104 deletions README.md

Large diffs are not rendered by default.

347 changes: 180 additions & 167 deletions docker-entrypoint.sh

Large diffs are not rendered by default.

0 comments on commit b9adcad

Please sign in to comment.