Skip to content

Instantly share code, notes, and snippets.

@MervinPraison
Forked from ekandreas/.dockerignore
Created January 29, 2021 00:28
Show Gist options
  • Save MervinPraison/b10ab1607c29a57a322f5b2ae165fa16 to your computer and use it in GitHub Desktop.
Save MervinPraison/b10ab1607c29a57a322f5b2ae165fa16 to your computer and use it in GitHub Desktop.
Dockerize your WordPress Bedrock
*
!docker.conf

Dockerize your WordPress Bedrock project

##Copy files Add these files to project root:

  • Dockerfile
  • .dockerignore
  • docker.conf
  • docker-compose.yml

Database

Change .env to new database (ip to Docker env)

Hosts

Add hosts so that the site will find its way

sudo nano /etc/hosts

Deployment

Change deploy with dipwpe

composer require deployer/deployer
composer require ekandreas/dipwpe

Configure deploy params

Check for EP_HOST in .env and set it to docker-machine-ip

Start Docker

Run docker-compose up -d

Stop Docker

Run docker-compose stop

Remove Docker

Run docker-compose rm

Initialization

To initialize the environment:

dep init development

Pull production

To pull from production:

dep pull production

Deploy

To deploy to production:

dep deploy production
include_once 'vendor/ekandreas/dipwpe/main.php';
env('remote.name','');
env('remote.path','/mnt/persist/www/');
env('remote.ssh','[email protected]');
env('remote.database','');
env('remote.domain','.se');
env('local.domain','.dev');
env('local.is_elastic',true);
web:
build: .
ports:
- "80:80"
volumes:
- ".:/var/www/html"
links:
- mysqldb:mysqldb
mysqldb:
image: mysql
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=your-project-database
ports:
- "3306:3306"
elastic:
image: elasticsearch
ports:
- "9200:9200"
<VirtualHost *:80>
ServerName intra.dev
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/web
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
<Directory /var/www/html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
FROM php:5.5-apache
MAINTAINER Andreas Ek <[email protected]>
RUN a2enmod rewrite
RUN apt-get update && apt-get install -y mysql-client libmysqlclient-dev
RUN docker-php-ext-install mysqli
ADD docker.conf /etc/apache2/sites-enabled/
EXPOSE 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment