Dockerfile.armhf 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # Stage 1:
  2. # - Copy Shaarli sources
  3. # - Build documentation
  4. FROM arm32v6/alpine:3.8 as docs
  5. ADD . /usr/src/app/shaarli
  6. RUN apk --update --no-cache add py2-pip \
  7. && cd /usr/src/app/shaarli \
  8. && pip install --no-cache-dir mkdocs \
  9. && mkdocs build --clean
  10. # Stage 2:
  11. # - Resolve PHP dependencies with Composer
  12. FROM arm32v6/alpine:3.8 as composer
  13. COPY --from=docs /usr/src/app/shaarli /app/shaarli
  14. RUN apk --update --no-cache add php7-curl php7-mbstring composer \
  15. && cd /app/shaarli \
  16. && composer --prefer-dist --no-dev install
  17. # Stage 3:
  18. # - Frontend dependencies
  19. FROM arm32v6/alpine:3.8 as node
  20. COPY --from=composer /app/shaarli /shaarli
  21. RUN apk --update --no-cache add yarn nodejs-current python2 build-base \
  22. && cd /shaarli \
  23. && yarn install \
  24. && yarn run build \
  25. && rm -rf node_modules
  26. # Stage 4:
  27. # - Shaarli image
  28. FROM arm32v6/alpine:3.8
  29. LABEL maintainer="Shaarli Community"
  30. RUN apk --update --no-cache add \
  31. ca-certificates \
  32. nginx \
  33. php7 \
  34. php7-ctype \
  35. php7-curl \
  36. php7-fpm \
  37. php7-gd \
  38. php7-iconv \
  39. php7-intl \
  40. php7-json \
  41. php7-mbstring \
  42. php7-openssl \
  43. php7-session \
  44. php7-xml \
  45. php7-zlib \
  46. s6
  47. COPY .docker/nginx.conf /etc/nginx/nginx.conf
  48. COPY .docker/php-fpm.conf /etc/php7/php-fpm.conf
  49. COPY .docker/services.d /etc/services.d
  50. RUN rm -rf /etc/php7/php-fpm.d/www.conf \
  51. && sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \
  52. && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php7/php.ini
  53. WORKDIR /var/www
  54. COPY --from=node /shaarli /var/www/shaarli
  55. RUN chown -R nginx:nginx . \
  56. && ln -sf /dev/stdout /var/log/nginx/shaarli.access.log \
  57. && ln -sf /dev/stderr /var/log/nginx/shaarli.error.log
  58. VOLUME /var/www/shaarli/cache
  59. VOLUME /var/www/shaarli/data
  60. EXPOSE 80
  61. ENTRYPOINT ["/bin/s6-svscan", "/etc/services.d"]
  62. CMD []