2020-04-26 17:40:35 +02:00
|
|
|
# Inherit from the farmOS 2.0.x base image.
|
|
|
|
FROM farmos/farmos:2.0.x-base
|
2020-04-20 04:09:56 +02:00
|
|
|
|
2020-04-26 17:40:35 +02:00
|
|
|
# Install git and unzip (needed by Composer).
|
|
|
|
RUN apt-get update -y \
|
|
|
|
&& apt-get install -y git unzip
|
|
|
|
|
|
|
|
# Install Composer.
|
|
|
|
RUN curl -sS https://getcomposer.org/installer | \
|
|
|
|
php -- --install-dir=/usr/bin/ --filename=composer
|
|
|
|
|
2020-04-27 17:15:08 +02:00
|
|
|
# Create a Composer config directory for the www-data user.
|
|
|
|
RUN mkdir /var/www/.composer && chown www-data:www-data /var/www/.composer
|
|
|
|
|
2020-04-28 06:27:58 +02:00
|
|
|
# Switch to the /var/www/farmOS directory as the www-data user.
|
|
|
|
WORKDIR /var/www/farmOS
|
2020-04-27 17:15:08 +02:00
|
|
|
USER www-data
|
|
|
|
|
2020-04-26 17:40:35 +02:00
|
|
|
# Generate an empty project from farmos/project.
|
2020-04-28 06:27:58 +02:00
|
|
|
RUN composer create-project --stability=dev farmos/project .
|
2020-04-26 17:40:35 +02:00
|
|
|
|
2020-04-28 06:27:58 +02:00
|
|
|
# Switch back to the /var/www/html directory as the root user.
|
|
|
|
WORKDIR /var/www/html
|
2020-04-27 17:15:08 +02:00
|
|
|
USER root
|
|
|
|
|
|
|
|
# Copy /var/www/farmOS to /var/www/html.
|
|
|
|
RUN rm -r /var/www/html && cp -r /var/www/farmOS /var/www/html
|
2020-04-26 17:40:35 +02:00
|
|
|
|
|
|
|
# Install and configure XDebug.
|
2020-04-20 04:09:56 +02:00
|
|
|
RUN yes | pecl install xdebug \
|
|
|
|
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
|
|
|
|
&& echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \
|
|
|
|
&& echo "xdebug.remote_autostart=off" >> /usr/local/etc/php/conf.d/xdebug.ini
|