Dockerfile 2.0 KB

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