Skip to content

Commit e552db7

Browse files
committed
Initial version of project
1 parent f6d6511 commit e552db7

6 files changed

Lines changed: 125 additions & 0 deletions

File tree

.docker/config/nginx.conf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
server {
2+
listen 80;
3+
index index.php index.html;
4+
server_name localhost;
5+
error_log /var/log/nginx/error.log;
6+
access_log /var/log/nginx/access.log;
7+
root /www/public;
8+
9+
location ~ \.php$ {
10+
try_files $uri =404;
11+
fastcgi_split_path_info ^(.+\.php)(/.+)$;
12+
fastcgi_pass php:9000;
13+
fastcgi_index index.php;
14+
include fastcgi_params;
15+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
16+
fastcgi_param PATH_INFO $fastcgi_path_info;
17+
}
18+
}

.docker/volumes/mysql/.gitkeep

Whitespace-only changes.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.docker/volumes/mysql/*
2+
!.docker/volumes/mysql/.gitkeep
3+
.DS_Store
4+

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Simple PHP for Docker
2+
3+
This project will drop in to an existing project and run it within Docker. It
4+
comes with the latest version of PHP-FPM, Nginx, MariaDB, Beanstalk, Redis and
5+
Mailhog for when you're using it in local development.
6+
7+
8+
## MariaDB/MySQL Password
9+
10+
The default root password is `vagrant` and the default database name is `vagrant`,
11+
both of these should be changed to suit your project. The data will be persisted
12+
across containers being created/destroyed in the `.docker/volumes/mysql`
13+
directory on your local machine (or server you deploy to).
14+
15+
16+
## nginx
17+
18+
You can overwrite the Nginx website config by editing the file that is located at
19+
`.docker/config/nginx.conf` which will be picked up on starting the container.
20+
21+
22+
## PHP
23+
24+
The included version of PHP-FPM includes GD, Intl and BZ2 extensions as well as
25+
Composer being installed as well.
26+
27+
28+
### License
29+
30+
This project is licensed under an Apache 2.0 license which you can find within
31+
this repository in the [LICENSE file](https://github.com/ssx/docker-simple-php/blob/master/LICENSE).
32+
33+
## Feedback
34+
35+
If you have any feedback, comments or suggestions, please feel free to open an
36+
issue within the repository on [Github](https://github.com/ssx/docker-php-fpm).

docker-compose.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
version: '2'
2+
3+
services:
4+
web:
5+
image: nginx:latest
6+
ports:
7+
- "8080:80"
8+
volumes:
9+
- ".:/www"
10+
- .docker/config/nginx.conf:/etc/nginx/conf.d/default.conf
11+
networks:
12+
- dev-network
13+
14+
php:
15+
image: hellossx/php-fpm
16+
volumes:
17+
- ".:/www"
18+
networks:
19+
- dev-network
20+
21+
mariadb:
22+
image: mariadb
23+
environment:
24+
- MYSQL_ROOT_PASSWORD=vagrant
25+
- MYSQL_DATABASE=vagrant
26+
volumes:
27+
- .docker/volumes/mysql:/var/lib/mysql
28+
networks:
29+
- dev-network
30+
31+
beanstalkd:
32+
image: hellossx/beanstalkd
33+
expose:
34+
- "11300"
35+
networks:
36+
- dev-network
37+
38+
beanstalkd_console:
39+
image: agaveapi/beanstalkd-console
40+
links:
41+
- "beanstalkd"
42+
environment:
43+
- BEANSTALKD_HOST=beanstalkd
44+
- BEANSTALKD_PORT=11300
45+
expose:
46+
- "80"
47+
ports:
48+
- "80"
49+
networks:
50+
- dev-network
51+
52+
mailhog:
53+
image: mailhog/mailhog
54+
ports:
55+
- "8002:8025"
56+
networks:
57+
- dev-network
58+
59+
redis:
60+
image: tutum/redis
61+
environment:
62+
- REDIS_PASS=**None**
63+
64+
networks:
65+
dev-network:
66+
driver: bridge

public/index.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?php phpinfo();

0 commit comments

Comments
 (0)