Compare commits

...

15 Commits

Author SHA1 Message Date
470873acd2 add Memcached support to the readme file 2016-05-12 15:23:42 +03:00
88d5dd7806 Merge pull request #44 from mattythebatty/memcached-support
Memcached support
2016-05-12 15:12:46 +03:00
295a0974da install php memcached 2016-05-12 02:28:44 +01:00
cf89670671 add memcached support 2016-05-12 02:17:39 +01:00
40899bc40f remove the duplicated volumes from DBs dockerfiles 2016-05-09 15:53:16 +03:00
64bf3222af set php work directory to laravel's directory 2016-05-09 15:45:54 +03:00
79009cc97e Merge branch 'benmag-master'
* benmag-master:
  Install pdo_pgsql extension
2016-05-09 14:59:13 +03:00
571bf64eb2 Install pdo_pgsql extension 2016-05-09 13:08:08 +10:00
75b1705820 Merge remote-tracking branch 'LaraDock/master' 2016-05-09 12:09:57 +10:00
12587bc712 Support Beanstalkd and Beanstalkd Console
Closes feature #38
2016-05-09 05:02:15 +03:00
81f2602464 Support MariaDB
closes feature #21
2016-05-09 04:23:03 +03:00
ecefee4d65 update postgres volume path 2016-05-09 04:20:03 +03:00
de8cbb0605 simple updates to docker compose and readme 2016-05-08 15:21:59 +03:00
aa338d534e Merge remote-tracking branch 'LaraDock/master' 2016-05-07 14:53:55 +10:00
ab7f3d8fd9 Merge remote-tracking branch 'LaraDock/master' 2016-05-07 12:12:43 +10:00
10 changed files with 124 additions and 25 deletions

View File

@ -1,6 +1,6 @@
# LaraDock # LaraDock
[![forthebadge](http://forthebadge.com/images/badges/built-with-love.svg)](http://www.zalt.me) [![forthebadge](http://forthebadge.com/images/badges/built-by-developers.svg)](http://zalt.me)
LaraDock helps you run your **Laravel** App on **Docker** real quick. LaraDock helps you run your **Laravel** App on **Docker** real quick.
@ -112,7 +112,11 @@ Running a virtual Container is much faster than running a full virtual Machine.
- NGINX - NGINX
- MySQL - MySQL
- PostgreSQL - PostgreSQL
- MariaDB
- Redis - Redis
- Memcached
- Beanstalkd
- Beanstalkd Console
- Data Volume - Data Volume
Cannot find your container! we would love to have it as well. Consider contributing your container and adding it to this list. Cannot find your container! we would love to have it as well. Consider contributing your container and adding it to this list.
@ -139,7 +143,7 @@ Cannot find your container! we would love to have it as well. Consider contribut
git clone https://github.com/LaraDock/laradock.git docker git clone https://github.com/LaraDock/laradock.git docker
``` ```
Instead of `git clone` you can use `git submodule add` in case you are already using Git for your Laravel project *(Recommended)*: You can use `git submodule add` instead of `git clone` if you are already using Git for your Laravel project *(Recommended)*:
```bash ```bash
git submodule add https://github.com/LaraDock/laradock.git docker git submodule add https://github.com/LaraDock/laradock.git docker
@ -154,7 +158,7 @@ git submodule add https://github.com/LaraDock/laradock.git docker
## Usage ## Usage
0 - For **Windows & MAC** users only: make sure you have a running Docker Virtual Host on your machine. 0 - For **Windows & MAC** users only: make sure you have a running Docker Virtual Host on your machine.
(**Linux** users don't need a Virtual Host, so skip this step) (**Linux** users don't need a Virtual Host, so skip this step).
<br> <br>
[How to run a Docker Virtual Host?](#Run-Docker-Virtual-Host) [How to run a Docker Virtual Host?](#Run-Docker-Virtual-Host)
@ -175,7 +179,7 @@ DB_HOST=xxx.xxx.xxx.xxx
> Running PHP, NGINX and MySQL: > Running PHP, NGINX and MySQL:
```bash ```bash
docker-compose up -d php nginx mysql docker-compose up -d php nginx mysql redis
``` ```
Note: you can choose your own combination of software's (containers), another example: Note: you can choose your own combination of software's (containers), another example:
@ -183,10 +187,10 @@ Note: you can choose your own combination of software's (containers), another ex
> Running PHP, NGINX, Postgres and Redis: > Running PHP, NGINX, Postgres and Redis:
```bash ```bash
docker-compose up -d php nginx postgres redis docker-compose up -d php nginx beanstalkd postgres
``` ```
Supported Containers: `php`, `nginx`, `mysql`, `postgres`, `redis`, `data`. Supported Containers: `nginx`, `mysql`, `redis`, `postgres`, `mariadb`, `Memcached`, `beanstalkd`, `beanstalkd-console`, `data`, `php`.
<br> <br>
3 - Open your browser and visit your `{Docker-IP}` address (`http://xxx.xxx.xxx.xxx`). 3 - Open your browser and visit your `{Docker-IP}` address (`http://xxx.xxx.xxx.xxx`).
@ -414,20 +418,12 @@ The Log files are stored in the `docker/logs` directory.
1 - first list the current running containers with `docker ps` 1 - first list the current running containers with `docker ps`
2 - enter any container with: 2 - enter any container using:
Example: enter the `php` container
```bash ```bash
docker exec -it php bash docker exec -it {container-name-or-id} bash
``` ```
3 - to exit a container, type `exit`.
Example: enter the `nginx` container
```bash
docker exec -it nginx bash
```
<br> <br>

View File

@ -0,0 +1,15 @@
FROM php:latest
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
RUN apt-get update && apt-get install -y curl
RUN curl -sL https://github.com/ptrofimov/beanstalk_console/archive/master.tar.gz | tar xvz -C /tmp
RUN mv /tmp/beanstalk_console-master /source
RUN apt-get remove --purge -y curl && apt-get autoclean && apt-get clean
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
EXPOSE 2080
CMD bash -c 'BEANSTALK_SERVERS=$BEANSTALKD_PORT_11300_TCP_ADDR:11300 php -S 0.0.0.0:2080 -t /source/public'

16
beanstalkd/Dockerfile Normal file
View File

@ -0,0 +1,16 @@
FROM phusion/baseimage:latest
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
ENV DEBIAN_FRONTEND noninteractive
ENV PATH /usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUN apt-get update
RUN apt-get install -y beanstalkd
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
VOLUME /var/lib/beanstalkd/data
EXPOSE 11300
CMD ["/usr/bin/beanstalkd"]

View File

@ -1,4 +1,5 @@
version: '2' version: '2'
services: services:
### Nginx Server Container ################################## ### Nginx Server Container ##################################
@ -30,8 +31,10 @@ services:
build: ./data build: ./data
volumes: volumes:
- /var/lib/mysql - /var/lib/mysql
- /var/lib/postgresql/data - /var/lib/postgres
- /var/lib/mariadb
- /var/lib/redis - /var/lib/redis
- /var/lib/memcached
### MySQL Container ######################################### ### MySQL Container #########################################
@ -64,6 +67,22 @@ services:
links: links:
- php - php
### MariaDB Container #######################################
mariadb:
build: ./mariadb
volumes_from:
- data
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: homestead
MYSQL_USER: homestead
MYSQL_PASSWORD: secret
MYSQL_ROOT_PASSWORD: root
links:
- php
### Redis Container ######################################### ### Redis Container #########################################
redis: redis:
@ -73,4 +92,30 @@ services:
ports: ports:
- "6379:6379" - "6379:6379"
### Beanstalkd Container ####################################
beanstalkd:
build: ./beanstalkd
ports:
- "11300:11300"
privileged: true
### Beanstalkd-Console Container ############################
beanstalkd-console:
build: ./beanstalkd-console
ports:
- "2080:2080"
links:
- beanstalkd
### Memcached Container #########################################
memcached:
build: ./memcached
volumes_from:
- data
ports:
- "11211:11211"
### Add more Containers below ############################### ### Add more Containers below ###############################

7
mariadb/Dockerfile Normal file
View File

@ -0,0 +1,7 @@
FROM mariadb:latest
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
CMD ["mysqld"]
EXPOSE 3306

7
memcached/Dockerfile Normal file
View File

@ -0,0 +1,7 @@
FROM memcached:latest
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
CMD ["memcached"]
EXPOSE 11211

View File

@ -2,8 +2,6 @@ FROM mysql:latest
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me> MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
VOLUME /var/lib/mysql
CMD ["mysqld"] CMD ["mysqld"]
EXPOSE 3306 EXPOSE 3306

View File

@ -1,3 +1,4 @@
# You can change the PHP version from here. After changing the PHP version, check the Memcached section below because it replies on PHP 7.
FROM php:7.0-fpm FROM php:7.0-fpm
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me> MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
@ -5,12 +6,28 @@ MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
ADD ./laravel.ini /usr/local/etc/php/conf.d ADD ./laravel.ini /usr/local/etc/php/conf.d
ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/ ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/
RUN apt-get update && apt-get install \
libpq-dev -y \
curl \
libmemcached-dev
# Install extensions using the helper script provided by the base image # Install extensions using the helper script provided by the base image
RUN docker-php-ext-install \ RUN docker-php-ext-install \
pdo_mysql pdo_mysql \
pdo_pgsql
# Install Memcached for php 7
RUN curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-memcached/archive/php7.tar.gz" \
&& mkdir -p /usr/src/php/ext/memcached \
&& tar -C /usr/src/php/ext/memcached -zxvf /tmp/memcached.tar.gz --strip 1 \
&& docker-php-ext-configure memcached \
&& docker-php-ext-install memcached \
&& rm /tmp/memcached.tar.gz
RUN usermod -u 1000 www-data RUN usermod -u 1000 www-data
WORKDIR /var/www/laravel
CMD ["php-fpm"] CMD ["php-fpm"]
EXPOSE 9000 EXPOSE 9000

View File

@ -2,8 +2,6 @@ FROM postgres:latest
MAINTAINER Ben M <git@bmagg.com> MAINTAINER Ben M <git@bmagg.com>
VOLUME /var/lib/postgresql/data
CMD ["postgres"] CMD ["postgres"]
EXPOSE 5432 EXPOSE 5432