-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 98345e1
Showing
6 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/mysql-data/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
redis: | ||
container_name: redis | ||
image: redis:3.0.7 | ||
ports: | ||
- 6379:6379 | ||
|
||
mysql: | ||
container_name: mysql | ||
image: mariadb:10.1.21 | ||
ports: | ||
- 3306:3306 | ||
volumes: | ||
- ~/.docker-php/mysql-data:/var/lib/mysql | ||
restart: always | ||
environment: | ||
MYSQL_ROOT_PASSWORD: root | ||
|
||
nginx: | ||
container_name: nginx | ||
image: nginx:1.11.10 | ||
ports: | ||
- 80:80 | ||
- 443:443 | ||
restart: always | ||
volumes: | ||
- ~/.docker-php/nginx-config/conf.d:/etc/nginx/conf.d | ||
- ~/Projects:/code | ||
links: | ||
- php | ||
|
||
php: | ||
container_name: php | ||
build: php-build | ||
expose: | ||
- 9000 | ||
restart: always | ||
volumes: | ||
- ~/.docker-php/php-config/php.ini:/usr/local/etc/php/conf.d/custom.ini | ||
- ~/Projects:/code | ||
links: | ||
- mysql | ||
- redis | ||
|
||
phpmyadmin: | ||
container_name: phpmyadmin | ||
image: phpmyadmin/phpmyadmin:4.6.6-2 | ||
restart: always | ||
links: | ||
- mysql | ||
ports: | ||
- 8080:80 | ||
environment: | ||
PMA_HOST: mysql |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
server { | ||
listen 80 default_server; | ||
server_name localhost _; | ||
index index.php index.html index.htm; | ||
root /code; | ||
|
||
location / { | ||
try_files $uri $uri/ /index.php?$query_string; | ||
autoindex on; | ||
} | ||
|
||
location ~ \.php$ { | ||
try_files $uri /index.php =404; | ||
fastcgi_split_path_info ^(.+\.php)(/.+)$; | ||
fastcgi_pass php:9000; | ||
fastcgi_index index.php; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
include fastcgi_params; | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM php:7.1.2-fpm | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
libfreetype6-dev \ | ||
libjpeg62-turbo-dev \ | ||
libmcrypt-dev \ | ||
libpng12-dev \ | ||
zlib1g-dev \ | ||
libzmq-dev | ||
|
||
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ | ||
&& docker-php-ext-install gd | ||
|
||
RUN docker-php-ext-install iconv mcrypt | ||
|
||
RUN docker-php-ext-install mysqli | ||
|
||
RUN docker-php-ext-install pdo pdo_mysql | ||
|
||
RUN pecl install --onlyreqdeps --force redis \ | ||
&& rm -rf /tmp/pear \ | ||
&& docker-php-ext-enable redis | ||
|
||
RUN pecl install zmq-beta \ | ||
&& docker-php-ext-enable zmq | ||
|
||
CMD ["php-fpm"] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
display_errors = On | ||
display_startup_errors = On | ||
default_charset = "UTF-8" | ||
html_errors = On |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
function docker-php() { | ||
action=$1 | ||
app=$2 | ||
|
||
if [[ -z $action || -z $app ]]; then | ||
echo "Necesitas especificar los parametros" | ||
else | ||
if [ "up" = "$action" ]; then | ||
if [[ ! -a ~/Projects/$app/docker.yml ]]; then | ||
echo "La aplicación no tiene archivo dock.yml." | ||
else | ||
docker-compose -f ~/.docker-php/docker-compose.yml -f ~/Projects/$app/docker.yml up -d | ||
fi | ||
elif [ "down" = "$action" ]; then | ||
if [[ ! -a ~/Projects/$app/docker.yml ]]; then | ||
echo "La aplicación no tiene archivo dock.yml." | ||
else | ||
docker-compose -f ~/.docker-php/docker-compose.yml -f ~/Projects/$app/docker.yml stop | ||
docker-compose -f ~/.docker-php/docker-compose.yml -f ~/Projects/$app/docker.yml rm -v | ||
fi | ||
elif [ "remove" = "$action" ]; then | ||
if [ "images" = "$app" ]; then | ||
docker rmi $(docker images -q) | ||
elif [ "containers" = "$app" ]; then | ||
docker stop $(docker ps -a -q) | ||
docker rm $(docker ps -a -q) -f -v | ||
docker-compose -f ~/.docker-php/docker-compose.yml rm -v | ||
fi | ||
fi | ||
fi | ||
|
||
} |