-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 \
php7-json \
php7-mbstring \
php7-openssl \
- php7-phar \
php7-session \
php7-xml \
php7-zlib \
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
- [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
+ }
+}
+```
- 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
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!
<div id="footer">
<strong><a href="https://github.com/shaarli/Shaarli">Shaarli</a></strong>
- The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community
- - <a href="doc/Home.html" rel="nofollow">Help/documentation</a>
+ - <a href="doc/html/index.html" rel="nofollow">Help/documentation</a>
{loop="$plugins_footer.text"}
{$value}
{/loop}