]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Merge pull request #1168 from virtualtam/docker/compose
authorAurélien Tamisier <virtualtam+github@flibidi.net>
Fri, 27 Jul 2018 17:25:52 +0000 (19:25 +0200)
committerGitHub <noreply@github.com>
Fri, 27 Jul 2018 17:25:52 +0000 (19:25 +0200)
Provide a Docker Compose example

Dockerfile
Dockerfile.armhf
doc/md/REST-API.md
doc/md/Upgrade-and-migration.md
mkdocs.yml
tpl/default/pluginsadmin.html
tpl/vintage/page.footer.html

index 6261e81bc1aaf5c75fb61cc5e2bc9546d115d524..d8921cee4cae2820a1448635f6ad1dab6425fe0b 100644 (file)
@@ -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 \
index 5dcc34aab006abed741c723197fa81004dd34b90..1185e2df6d800656cf96c4d32fde2698f438fdf7 100644 (file)
@@ -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
index c016de56a6ff031a77fb4bffe7cb514b52a1878f..11bd1cd22f9a62a275ef3b5ce8570849545bb00e 100644 (file)
@@ -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
+  }
+}
+```
index 451ca36dee1e9300ff27c9389a246c7afd0f2fde..d5682a340dd35d650e8ed025ca4d5e75e666ba99 100644 (file)
@@ -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!
 
index c66d164b854c3cd167d00925917224662f5ed621..ae38459bfd9a5d0dcfe5da72559662cb56973987 100644 (file)
@@ -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
index 8f2597df83b82e313706b8de342a5e4186e5e021..820419725f7469e1f96fe94a46293b5ed9f97578 100644 (file)
 
       <div class="center more">
         {"More plugins available"|t}
-        <a href="doc/Community-&-Related-software.html#third-party-plugins">{"in the documentation"|t}</a>.
+        <a href="doc/html/Community-&-Related-software/#third-party-plugins">{"in the documentation"|t}</a>.
       </div>
       <div class="center">
         <input type="submit" value="{'Save'|t}" name="save">
index f409721e7271ecdd5be90181623276332513e80d..a3380841b5d35e00dccbafa2e7949c99ece0793a 100644 (file)
@@ -1,7 +1,7 @@
 <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}