Provide a development Dockerfile that extends the base farmOS image.

This commit is contained in:
Michael Stenta 2019-04-20 17:25:29 -04:00
parent aded7a8787
commit c353068bf4
3 changed files with 40 additions and 1 deletions

28
docker/dev/Dockerfile Normal file
View File

@ -0,0 +1,28 @@
# Inherit from the farmOS 7.x-1.x image.
FROM farmos/farmos:7.x-1.x
# Set the farmOS version to the development branch.
ENV FARMOS_VERSION 7.x-1.x
# Install git and unzip for use by Drush Make.
RUN apt-get update && apt-get install -y git unzip
# Install Drush 8 with the phar file.
ENV DRUSH_VERSION 8.2.1
RUN curl -fsSL -o /usr/local/bin/drush "https://github.com/drush-ops/drush/releases/download/${DRUSH_VERSION}/drush.phar" && \
chmod +x /usr/local/bin/drush && \
drush core-status
# Install mariadb-client so Drush can connect to the database.
RUN apt-get update && apt-get install -y mariadb-client
# Build the farmOS repository in /tmp/farmOS.
RUN git clone --branch ${FARMOS_VERSION} https://git.drupal.org/project/farm.git /tmp/farmOS && \
drush make --working-copy --no-gitinfofile /tmp/farmOS/build-farm.make /tmp/www && \
chown -R www-data:www-data /tmp/www
# Set the entrypoint.
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod u+x /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["apache2-foreground"]

View File

@ -0,0 +1,11 @@
#!/bin/bash
set -e
# If the webroot directory is empty, copy from /tmp/www.
if ! [ "$(ls -A /var/www/html/)" ]; then
cp -rp /tmp/www/. /var/www/html
fi
# Execute the arguments passed into this script.
echo "Attempting: $@"
exec "$@"

View File

@ -15,7 +15,7 @@ services:
www:
depends_on:
- db
image: farmos/farmos:7.x-1.x
image: farmos/farmos:dev
volumes:
- './www:/var/www/html'
ports: