Compare commits
15 Commits
Author | SHA1 | Date | |
---|---|---|---|
470873acd2 | |||
88d5dd7806 | |||
295a0974da | |||
cf89670671 | |||
40899bc40f | |||
64bf3222af | |||
79009cc97e | |||
571bf64eb2 | |||
75b1705820 | |||
12587bc712 | |||
81f2602464 | |||
ecefee4d65 | |||
de8cbb0605 | |||
aa338d534e | |||
ab7f3d8fd9 |
30
README.md
30
README.md
@ -1,6 +1,6 @@
|
|||||||
# LaraDock
|
# LaraDock
|
||||||
|
|
||||||
[](http://www.zalt.me)
|
[](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>
|
||||||
|
15
beanstalkd-console/Dockerfile
Normal file
15
beanstalkd-console/Dockerfile
Normal 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
16
beanstalkd/Dockerfile
Normal 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"]
|
@ -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
7
mariadb/Dockerfile
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
FROM mariadb:latest
|
||||||
|
|
||||||
|
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
||||||
|
|
||||||
|
CMD ["mysqld"]
|
||||||
|
|
||||||
|
EXPOSE 3306
|
7
memcached/Dockerfile
Normal file
7
memcached/Dockerfile
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
FROM memcached:latest
|
||||||
|
|
||||||
|
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
||||||
|
|
||||||
|
CMD ["memcached"]
|
||||||
|
|
||||||
|
EXPOSE 11211
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
Reference in New Issue
Block a user