Compare commits

...

11 Commits

9 changed files with 94 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.
@ -110,9 +110,12 @@ Running a virtual Container is much faster than running a full virtual Machine.
- PHP (7.0 - 5.6 - 5.5) - PHP (7.0 - 5.6 - 5.5)
- NGINX - NGINX
- Redis
- MySQL - MySQL
- PostgreSQL - PostgreSQL
- Redis - MariaDB
- 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 +142,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 +157,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 +178,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 +186,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`, `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 +417,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,7 +31,8 @@ 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
### MySQL Container ######################################### ### MySQL Container #########################################
@ -64,6 +66,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 +91,21 @@ 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
### 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

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

@ -5,12 +5,17 @@ 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
# 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
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