Dockerfile-installer 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Specify the version of PHP we use for our Chevereto
  2. ARG PHP_VERSION=7.4-apache
  3. FROM alpine as downloader
  4. RUN apk add --no-cache curl && \
  5. mkdir -p /extracted/Chevereto/images && \
  6. cd /extracted/Chevereto && \
  7. curl -sS -o index.php -L "https://chevereto.com/download/file/installer"
  8. COPY settings.php /extracted/Chevereto/app/settings.php
  9. FROM php:$PHP_VERSION
  10. # Install required packages and configure
  11. RUN apt-get update && apt-get install -y \
  12. libgd-dev \
  13. libzip-dev && \
  14. bash -c 'if [[ $PHP_VERSION == 7.4.* ]]; then \
  15. docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/; \
  16. else \
  17. docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/; \
  18. fi' && \
  19. docker-php-ext-install \
  20. exif \
  21. gd \
  22. mysqli \
  23. pdo \
  24. pdo_mysql \
  25. zip && \
  26. a2enmod rewrite
  27. # Download installer script
  28. COPY --from=downloader --chown=33:33 /extracted/Chevereto /var/www/html
  29. # Expose the image directory as a volume
  30. VOLUME /var/www/html/images
  31. # DB connection environment variables
  32. ENV CHEVERETO_DB_HOST=db CHEVERETO_DB_USERNAME=chevereto CHEVERETO_DB_PASSWORD=chevereto CHEVERETO_DB_NAME=chevereto CHEVERETO_DB_PREFIX=chv_ CHEVERETO_DB_PORT=3306
  33. ARG BUILD_DATE
  34. # Set all required labels, we set it here to make sure the file is as reusable as possible
  35. LABEL org.label-schema.url="https://github.com/tanmng/docker-chevereto" \
  36. org.label-schema.name="Chevereto Free" \
  37. org.label-schema.license="Apache-2.0" \
  38. org.label-schema.vcs-url="https://github.com/tanmng/docker-chevereto" \
  39. maintainer="Tan Nguyen <[email protected]>" \
  40. build_signature="Chevereto installer; built on ${BUILD_DATE}; Using PHP version ${PHP_VERSION}"