From: Jerome Jutteau Date: Tue, 5 Jul 2022 07:59:08 +0000 (+0200) Subject: [TASK] simplify Dockerfile X-Git-Tag: 4.5.0~15 X-Git-Url: https://git.p6c8.net/jirafeau_project.git/commitdiff_plain/9a72b7f56fa8d77ef5de841d2248d7bb71d9733a?ds=sidebyside [TASK] simplify Dockerfile Signed-off-by: Jerome Jutteau --- diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3791a81 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +CHANGELOG.md +CONTRIBUTING.md +Dockerfile +README.md +composer.json +.* \ No newline at end of file diff --git a/.gitignore b/.gitignore index f2a258c..c911a76 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ composer.phar # Ignore file starting with dot, but keep others .* !.gitlab-ci.yml -!.gitignore \ No newline at end of file +!.gitignore +!.dockerignore \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index e0b81bf..776fec0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,16 +7,17 @@ RUN apk update && \ echo "UTC" > /etc/timezone # install lighttpd -RUN apk add lighttpd git +RUN apk add lighttpd # install jirafeau RUN mkdir /www WORKDIR /www -COPY .git .git -RUN git reset --hard && rm -rf docker install.php .git .gitignore .gitlab-ci.yml CONTRIBUTING.md Dockerfile README.md -RUN touch /www/lib/config.local.php -RUN chown -R $(id -u lighttpd).$(id -g www-data) /www -RUN chmod o=,ug=rwX -R /www +# Will ignore some files through .dockerignore +COPY . . +RUN rm -rf docker && \ + touch /www/lib/config.local.php && \ + chown -R $(id -u lighttpd).$(id -g www-data) /www && \ + chmod o=,ug=rwX -R /www COPY docker/cleanup.sh /cleanup.sh COPY docker/run.sh /run.sh @@ -28,7 +29,6 @@ COPY docker/php.ini /usr/local/etc/php/php.ini COPY docker/lighttpd.conf /etc/lighttpd/lighttpd.conf # cleanup -RUN apk del git RUN rm -rf /var/cache/apk/* CMD /run.sh