[TASK] simplify Dockerfile

Signed-off-by: Jerome Jutteau <jerome@jutteau.fr>
This commit is contained in:
Jerome Jutteau 2022-07-05 09:59:08 +02:00
parent b8d29136e6
commit 9a72b7f56f
3 changed files with 15 additions and 8 deletions

6
.dockerignore Normal file
View File

@ -0,0 +1,6 @@
CHANGELOG.md
CONTRIBUTING.md
Dockerfile
README.md
composer.json
.*

1
.gitignore vendored
View File

@ -11,3 +11,4 @@ composer.phar
.*
!.gitlab-ci.yml
!.gitignore
!.dockerignore

View File

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