2023-10-24 08:47:42 +02:00
|
|
|
# Use the official Drupal 10 image to build GEOS PHP extension.
|
|
|
|
FROM drupal:10.1 as php-dependencies
|
2023-10-12 07:46:49 +02:00
|
|
|
|
|
|
|
# Build and install the GEOS PHP extension.
|
|
|
|
# See https://git.osgeo.org/gitea/geos/php-geos
|
|
|
|
ARG PHP_GEOS_VERSION=e77d5a16abbf89a59d947d1fe49381a944762c9d
|
|
|
|
ADD https://github.com/libgeos/php-geos/archive/${PHP_GEOS_VERSION}.tar.gz /opt/php-geos.tar.gz
|
|
|
|
RUN apt-get update && apt-get install -y libgeos-dev \
|
|
|
|
&& ( tar xzf /opt/php-geos.tar.gz -C /opt/ \
|
|
|
|
&& cd /opt/php-geos-${PHP_GEOS_VERSION} \
|
|
|
|
&& ./autogen.sh \
|
|
|
|
&& ./configure \
|
|
|
|
&& make \
|
|
|
|
&& make install \
|
2023-10-24 08:47:42 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
# Install the BCMath PHP extension.
|
|
|
|
RUN docker-php-ext-install bcmath
|
2023-10-12 07:46:49 +02:00
|
|
|
|
|
|
|
# Inherit from the official Drupal 10 image.
|
2023-10-05 22:19:16 +02:00
|
|
|
FROM drupal:10.1
|
2020-04-26 17:42:51 +02:00
|
|
|
|
2020-08-01 22:02:04 +02:00
|
|
|
# Set the farmOS and composer project repository URLs and versions.
|
|
|
|
ARG FARMOS_REPO=https://github.com/farmOS/farmOS.git
|
2023-09-30 22:31:53 +02:00
|
|
|
ARG FARMOS_VERSION=3.x
|
2020-08-01 22:02:04 +02:00
|
|
|
ARG PROJECT_REPO=https://github.com/farmOS/composer-project.git
|
2023-09-30 22:31:53 +02:00
|
|
|
ARG PROJECT_VERSION=3.x
|
2020-08-01 22:02:04 +02:00
|
|
|
|
2021-08-25 12:19:33 +02:00
|
|
|
# Set Apache ServerName directive globally to suppress AH00558 message.
|
|
|
|
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
|
|
|
|
2023-10-12 07:46:49 +02:00
|
|
|
# Install and enable geos.
|
2023-10-24 08:47:42 +02:00
|
|
|
COPY --from=php-dependencies /usr/local/lib/php/extensions/ /usr/local/lib/php/extensions/
|
|
|
|
RUN docker-php-ext-enable geos bcmath
|
2020-08-12 16:09:35 +02:00
|
|
|
|
2023-10-12 07:44:40 +02:00
|
|
|
# Add custom PHP configurations.
|
|
|
|
COPY conf.d/ /usr/local/etc/php/conf.d
|
2020-08-20 22:30:57 +02:00
|
|
|
|
2023-10-12 07:46:49 +02:00
|
|
|
# Install apt dependencies.
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
# Install git and unzip (needed by Composer).
|
|
|
|
git unzip \
|
|
|
|
# Install postgresql-client so Drush can connect to the database.
|
|
|
|
postgresql-client \
|
|
|
|
# Install libgeos-c1v5 so geos php extension can use libgeos_c.so.1.
|
|
|
|
libgeos-c1v5 \
|
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
|
|
&& apt-get clean
|
2020-08-12 16:09:35 +02:00
|
|
|
|
|
|
|
# Set the COMPOSER_MEMORY_LIMIT environment variable to unlimited.
|
|
|
|
ENV COMPOSER_MEMORY_LIMIT=-1
|
|
|
|
|
2020-08-12 17:17:39 +02:00
|
|
|
# Add the build-farmOS.sh script.
|
|
|
|
COPY build-farmOS.sh /usr/local/bin/
|
|
|
|
RUN chmod a+x /usr/local/bin/build-farmOS.sh
|
|
|
|
|
|
|
|
# Build the farmOS codebase in /var/farmoS with the --no-dev flag.
|
|
|
|
# Change the ownership of the sites directory and copy the farmOS codebase into /opt/drupal.
|
|
|
|
RUN mkdir /var/farmOS \
|
|
|
|
&& /usr/local/bin/build-farmOS.sh --no-dev \
|
|
|
|
&& chown -R www-data:www-data /var/farmOS/web/sites \
|
2020-08-12 16:36:42 +02:00
|
|
|
&& rm -r /opt/drupal && cp -rp /var/farmOS /opt/drupal
|
2020-08-12 16:09:35 +02:00
|
|
|
|
|
|
|
# Set the entrypoint.
|
|
|
|
COPY docker-entrypoint.sh /usr/local/bin/
|
|
|
|
ENTRYPOINT ["docker-entrypoint.sh"]
|
|
|
|
CMD ["apache2-foreground"]
|