-
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.
Merge pull request #5 from nspalo/webstack/v1.0.0
Webstack/v1.0.0
- Loading branch information
Showing
8 changed files
with
184 additions
and
5 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 |
---|---|---|
@@ -1,2 +1,5 @@ | ||
# Environment | ||
/.idea | ||
/.idea | ||
|
||
# MySQL | ||
/docker/containers/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 |
---|---|---|
@@ -1,9 +1,21 @@ | ||
# Docker Study | ||
> This is a simple repo to learn the basics in setting up a | ||
> *Web development environment with __Docker__*. | ||
> This is a simple repo to learn the basics in setting up a | ||
> *Web development environment with NginX, MySQL, and PHP inside a __Docker__ container*. | ||
## Web Stack | ||
- Docker Containers | ||
- nginx | ||
- mysql | ||
- php | ||
- NginX | ||
- nginx:stable-alpine | ||
- MySQL 5.7 | ||
- mysql:5.7.22 | ||
- PHP 7 | ||
- php:7.2-fpm-alpine | ||
|
||
## Table of Contents | ||
| Branch Name | What's Inside | | ||
| ------------- | ------------- | | ||
| [webstack/v1.0.0](https://github.com/nspalo/docker-study/tree/webstack/v1.0.0) | nginx:stable-alpine, mysql:5.7.22, php:7.2-fpm-alpine | | ||
| [webstack/v2.0.0](https://github.com/nspalo/docker-study/tree/webstack/v2.0.0) | nginx:stable-alpine, mysql:5.7.22, php:7.4-fpm-alpine | | ||
| [webstack/v2.0.0](https://github.com/nspalo/docker-study/tree/webstack/v2.0.0) | nginx:stable-alpine, mysql:5.7.22, php:7.4-fpm-alpine | |
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
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,5 @@ | ||
# Install PHP 7.2 | ||
FROM php:7.2-fpm-alpine | ||
|
||
# Install PHP Extension | ||
RUN docker-php-ext-install pdo pdo_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,22 @@ | ||
server { | ||
listen 80; | ||
index index.php index.html; | ||
# server_name <ServerName>; | ||
error_log /var/log/nginx/error.log; | ||
access_log /var/log/nginx/access.log; | ||
root /var/www/html/public/; | ||
|
||
location ~ \.php$ { | ||
try_files $uri =404; | ||
fastcgi_split_path_info ^(.+\.php)(/.+)$; | ||
fastcgi_pass php:9000; | ||
fastcgi_index index.php; | ||
include fastcgi_params; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
fastcgi_param PATH_INFO $fastcgi_path_info; | ||
} | ||
|
||
location / { | ||
try_files $uri $uri/ /index.php?$query_string; | ||
} | ||
} |
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,54 @@ | ||
version: '3' | ||
|
||
networks: | ||
web-app: | ||
|
||
services: | ||
# Container: NginX | ||
nginx: | ||
networks: | ||
- web-app | ||
container_name: nginx | ||
image: library/nginx:stable-alpine | ||
ports: | ||
- "9100:80" | ||
volumes: | ||
- ../../src:/var/www/html | ||
- ../../docker/containers/nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf | ||
depends_on: | ||
- php | ||
- mysql | ||
|
||
# Container: MySQL | ||
mysql: | ||
networks: | ||
- web-app | ||
container_name: mysql | ||
image: library/mysql:5.7.22 | ||
restart: unless-stopped | ||
tty: true | ||
ports: | ||
- "3306:3306" | ||
volumes: | ||
- ../../docker/containers/mysql:/var/lib/mysql | ||
environment: | ||
MYSQL_DATABASE: db_docker_study | ||
MYSQL_USER: dbUserDev | ||
MYSQL_PASSWORD: dbUserDev123 | ||
MYSQL_ROOT_PASSWORD: dbUserRoot123 | ||
SERVICE_TAGS: dev | ||
SERVICE_NAME: mysql | ||
|
||
# Container: PHP | ||
php: | ||
networks: | ||
- web-app | ||
container_name: php | ||
build: | ||
context: ./ | ||
dockerfile: ../../docker/containers/Dockerfile | ||
image: php:php7.2-fpm-alpine | ||
ports: | ||
- "9000:9000" | ||
volumes: | ||
- ../../src:/var/www/html |
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
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,10 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Test - NginX</title> | ||
</head> | ||
<body> | ||
<h1>It Works!!!</h1> | ||
</body> | ||
</html> |