Skip to content
This repository has been archived by the owner on Dec 27, 2019. It is now read-only.

Commit

Permalink
Adds a Dockerfile and docker-compose file
Browse files Browse the repository at this point in the history
First pass at starting up a blank Boston.gov install with a few
repeatable commands.

Major change is to run the "update" functions inside the hook_installs
for the bos_profile and bos_core. This is based on the assumption that
upgrading in production will not run hook_install.

Currently only tested for Boston.gov, not for The Hub.
  • Loading branch information
Fin Hopkins committed Jan 24, 2018
1 parent 5043399 commit 6312abd
Show file tree
Hide file tree
Showing 19 changed files with 2,279 additions and 1,530 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Dockerfile
docker-compose.yml

/node_modules
/vendor
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM php:5.6-apache

WORKDIR /boston.gov
ENV APACHE_DOCUMENT_ROOT /boston.gov/docroot
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf && \
sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf && \
a2enmod rewrite

RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get update && \
apt-get install -y --no-install-recommends git zip unzip bzip2 rsync nodejs libgd-dev mysql-client && \
docker-php-ext-install pdo_mysql gd
RUN curl --silent --show-error https://getcomposer.org/installer | php
RUN mv composer.phar /usr/local/bin/composer

ADD default.php.ini /usr/local/etc/php/php.ini

ADD package.json package-lock.json /boston.gov/
RUN npm install

ADD composer.json composer.lock /boston.gov/
RUN composer install
RUN ln -s vendor/drush/drush/drush /usr/local/bin/drush

ADD . /boston.gov
RUN ./task.sh setup:build:make
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,44 @@ If you're interested in helping Boston.gov, there are three ways to help. Be sur

Get started with our [developer guide](https://github.com/CityOfBoston/boston.gov/blob/develop/guides/02-setting-up-development.md). Each contributor should [fork](https://help.github.com/articles/fork-a-repo) the primary Boston.gov repo. All developers should then checkout a local copy of the `develop` branch to begin work.

### Docker Quick-Start

1. Download [Docker for
Mac](https://www.docker.com/docker-machttps://www.docker.com/docker-mac) or
[Docker for Windows](https://www.docker.com/docker-windows), or otherwise get
a Docker environment with Docker Compose installed.
1. Clone this repo
1. Run `docker-compose up` in the root directory
1. Initialize the database: `docker exec bostongov_drupal_1 scripts/init-docker-container.sh` (this will take 10+ minutes)
1. Visit http:https://localhost:8888/ to see the blank install. Visit
http:https://localhost:8888/user?local to log in, with admin/admin as username and
password.

The Hub — our internal Drupal install — can run in the same container and
against the same MySQL server. To initialize it, run:

`docker exec bostongov_drupal_1 scripts/init-docker-container.sh hub`

It’s available at http:https://localhost:8889/ and you can log in with admin/admin at
http:https://localhost:8889/user?local

Since pulling files through the Docker volume mount is relatively slow, we keep
vendored packages within the container and only map in our custom directories.
So, only local edits to the following directories will be seen within the
container:

```
docroot/profiles
docroot/sites/default
docroot/sites/hub
docroot/sites/all/modules/custom
docroot/sites/all/modules/features
docroot/sites/all/settings
docroot/sites/all/themes/custom
```

You can modify this list by editing `scripts/init-docker-container.sh`


## Public domain

Expand Down
Loading

0 comments on commit 6312abd

Please sign in to comment.