From: Aurélien Tamisier Date: Fri, 27 Jul 2018 17:25:52 +0000 (+0200) Subject: Merge pull request #1168 from virtualtam/docker/compose X-Git-Tag: v0.10.0~3 X-Git-Url: https://git.immae.eu/?p=github%2Fshaarli%2FShaarli.git;a=commitdiff_plain;h=8fdd65b88412a0db28c723a486650c434fe5668c;hp=a0c34a49765ecc2559ac51b62966b9785ff3a5a3 Merge pull request #1168 from virtualtam/docker/compose Provide a Docker Compose example --- diff --git a/Dockerfile b/Dockerfile index 6261e81b..d8921cee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,7 @@ RUN cd shaarli \ # Stage 4: # - Shaarli image -FROM alpine:3.7 +FROM alpine:3.8 LABEL maintainer="Shaarli Community" RUN apk --update --no-cache add \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 5dcc34aa..1185e2df 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -1,9 +1,38 @@ -FROM lsiobase/alpine.armhf:3.6 +# Stage 1: +# - Copy Shaarli sources +# - Build documentation +FROM arm32v6/alpine:3.8 as docs +ADD . /usr/src/app/shaarli +RUN apk --update --no-cache add py2-pip \ + && cd /usr/src/app/shaarli \ + && pip install --no-cache-dir mkdocs \ + && mkdocs build --clean + +# Stage 2: +# - Resolve PHP dependencies with Composer +FROM arm32v6/alpine:3.8 as composer +COPY --from=docs /usr/src/app/shaarli /app/shaarli +RUN apk --update --no-cache add php7-mbstring composer \ + && cd /app/shaarli \ + && composer --prefer-dist --no-dev install + +# Stage 3: +# - Frontend dependencies +FROM arm32v6/alpine:3.8 as node +COPY --from=composer /app/shaarli /shaarli +RUN apk --update --no-cache add yarn nodejs-current python2 build-base \ + && cd /shaarli \ + && yarn install \ + && yarn run build \ + && rm -rf node_modules + +# Stage 4: +# - Shaarli image +FROM arm32v6/alpine:3.8 LABEL maintainer="Shaarli Community" RUN apk --update --no-cache add \ ca-certificates \ - curl \ nginx \ php7 \ php7-ctype \ @@ -15,7 +44,6 @@ RUN apk --update --no-cache add \ php7-json \ php7-mbstring \ php7-openssl \ - php7-phar \ php7-session \ php7-xml \ php7-zlib \ @@ -25,22 +53,19 @@ COPY .docker/nginx.conf /etc/nginx/nginx.conf COPY .docker/php-fpm.conf /etc/php7/php-fpm.conf COPY .docker/services.d /etc/services.d -RUN curl -sS https://getcomposer.org/installer | php7 -- --install-dir=/usr/local/bin --filename=composer \ - && rm -rf /etc/php7/php-fpm.d/www.conf \ +RUN rm -rf /etc/php7/php-fpm.d/www.conf \ && sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \ && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php7/php.ini WORKDIR /var/www -RUN curl -L https://github.com/shaarli/Shaarli/archive/master.tar.gz | tar xzf - \ - && mv Shaarli-master shaarli \ - && cd shaarli \ - && composer --prefer-dist --no-dev install \ - && rm -rf ~/.composer \ - && chown -R nginx:nginx . \ +COPY --from=node /shaarli /var/www/shaarli + +RUN chown -R nginx:nginx . \ && ln -sf /dev/stdout /var/log/nginx/shaarli.access.log \ && ln -sf /dev/stderr /var/log/nginx/shaarli.error.log +VOLUME /var/www/shaarli/cache VOLUME /var/www/shaarli/data EXPOSE 80 diff --git a/doc/md/REST-API.md b/doc/md/REST-API.md index c016de56..11bd1cd2 100644 --- a/doc/md/REST-API.md +++ b/doc/md/REST-API.md @@ -152,3 +152,22 @@ See the reference API client: - [Documentation](http://python-shaarli-client.readthedocs.io/en/latest/) on ReadTheDocs - [python-shaarli-client](https://github.com/shaarli/python-shaarli-client) on Github + +## Troubleshooting + +### Debug mode + +> This should never be used in a production environment. + +For security reasons, authentication issues will always return an `HTTP 401` error code without any detail. + +It is possible to enable the debug mode in `config.json.php` +to get the actual error message in the HTTP response body with: + +```json +{ + "dev": { + "debug": true + } +} +``` diff --git a/doc/md/Upgrade-and-migration.md b/doc/md/Upgrade-and-migration.md index 451ca36d..d5682a34 100644 --- a/doc/md/Upgrade-and-migration.md +++ b/doc/md/Upgrade-and-migration.md @@ -27,7 +27,7 @@ As all user data is kept under `data`, this is the only directory you need to wo - backup the `data` directory - install or update Shaarli: - - fresh installation - see [Download and installation](Download-and-installation) + - fresh installation - see [Download and Installation](Download-and-Installation) - update - see the following sections - check or restore the `data` directory @@ -35,7 +35,7 @@ As all user data is kept under `data`, this is the only directory you need to wo All tagged revisions can be downloaded as tarballs or ZIP archives from the [releases](https://github.com/shaarli/Shaarli/releases) page. -We recommend that you use the latest release tarball with the `-full` suffix. It contains the dependencies, please read [Download and installation](Download-and-installation) for `git` complete instructions. +We recommend that you use the latest release tarball with the `-full` suffix. It contains the dependencies, please read [Download and Installation](Download-and-Installation) for `git` complete instructions. Once downloaded, extract the archive locally and update your remote installation (e.g. via FTP) -be sure you keep the content of the `data` directory! diff --git a/mkdocs.yml b/mkdocs.yml index c66d164b..ae38459b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -5,7 +5,10 @@ site_description: The personal, minimalist, super-fast, database free, bookmarki theme: readthedocs docs_dir: doc/md site_dir: doc/html -strict: true +# Disable strict mode until ReadTheDocs provides up-to-date MkDocs settings: +# - https://github.com/shaarli/Shaarli/issues/1179 +# - https://github.com/rtfd/readthedocs.org/issues/4314 +# strict: true pages: - Home: index.md diff --git a/tpl/default/pluginsadmin.html b/tpl/default/pluginsadmin.html index 8f2597df..82041972 100644 --- a/tpl/default/pluginsadmin.html +++ b/tpl/default/pluginsadmin.html @@ -117,7 +117,7 @@
{"More plugins available"|t} - {"in the documentation"|t}. + {"in the documentation"|t}.
diff --git a/tpl/vintage/page.footer.html b/tpl/vintage/page.footer.html index f409721e..a3380841 100644 --- a/tpl/vintage/page.footer.html +++ b/tpl/vintage/page.footer.html @@ -1,7 +1,7 @@