Last active
January 13, 2017 13:49
-
-
Save rdlmda/36832b2a2632be985148f8950466e5ad to your computer and use it in GitHub Desktop.
Dockerized WordPress and Drupal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Running CMS's like WordPress and Drupal in dockerized instances. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker pull postgres:9.3 | |
| docker pull drupal:7.50 | |
| docker run --name drupal-db -e POSTGRES_PASSWORD=drupal -e POSTGRES_USER=drupal -p 5432:5432 -d postgres:9.3 | |
| docker run --name drupal --link drupal-db:postgres -p 80:80 -d drupal:7.50 | |
| git clone [email protected]:DockerDemos/appstack-drush.git | |
| docker build -t drush appstack-drush | |
| # Install Drupal on the browser, using "drupal" as username, db and pwd;host is "postgres" | |
| docker run --link drupal-db:postgres --volumes-from drupal -w /var/www/html -it drush drush sql-cli |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker pull mysql:5.7 | |
| docker pull wordpress:4.5 | |
| docker run --name wp-db -e MYSQL_ROOT_PASSWORD=wordpress -e MYSQL_DATABASE=wordpress -p 3306:3306 -d mysql:5.7 | |
| docker run --name wp --link wp-db:mysql -p 80:80 -d wordpress:4.5 | |
| git clone [email protected]:DockerDemos/appstack-wpcli.git | |
| docker build -t wpcli appstack-wpcli | |
| docker run --link wp-db:mysql --volumes-from wp -w /var/www/html -it wpcli wp --allow-root core install --url=localhost --title=test --admin_user=admin --admin_password=admin [email protected] | |
| docker run --link wp-db:mysql --volumes-from wp -w /var/www/html -it wpcli wp --allow-root user list |
Author
Author
Instead of appstack-drush, use this Dockerfile to build the drush image:
FROM drupal:7.50
RUN apt-get update && apt-get install -y postgresql php5-pgsql
RUN curl -fSL "https://s3.amazonaws.com/files.drush.org/drush.phar" -o drush && chmod +x drush && mv drush /usr/local/bin
WORKDIR /var/www/html
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Drush isn't currently working for some reason. Investigating on it.