Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/juancarlosqr/docker-php-dev
PHP Development with Docker
https://github.com/juancarlosqr/docker-php-dev
docker docker-compose mariadb nginx php7
Last synced: 3 months ago
JSON representation
PHP Development with Docker
- Host: GitHub
- URL: https://github.com/juancarlosqr/docker-php-dev
- Owner: juancarlosqr
- Created: 2015-08-09T18:25:10.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-03-25T20:30:55.000Z (almost 6 years ago)
- Last Synced: 2023-08-12T11:57:59.120Z (over 1 year ago)
- Topics: docker, docker-compose, mariadb, nginx, php7
- Language: PHP
- Homepage:
- Size: 24.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PHP Development with Docker
![docker image](src/assets/docker.png)
## About
> This environment was created to work for vanilla PHP only. It might not work for frameworks
- PHP development environment running on Docker
- Includes Nginx and MariaDB
- Each service runs on its own docker container## How to use
1. Install __docker__ and __docker-compose__. Read how on the [docker docs](https://docs.docker.com/)
2. Clone this repo
3. Put your `php` code inside the `src` folder
4. Run `docker-compose up` (Add `-d` to run in background)
5. Go to `http://localhost` on your browser
6. Enjoy!
7. Type `Ctrl+C` to stop containers (or `docker-compose stop`)## Images used
- [PHP](https://hub.docker.com/_/php)
- [Nginx](https://hub.docker.com/_/nginx)
- [MariaDB](https://hub.docker.com/_/mariadb)## Sources
- [A docker-compose PHP environment from scratch](https://x-team.com/blog/docker-compose-php-environment-from-scratch/)
- [Dockerise your PHP application with Nginx and PHP7-FPM](http://geekyplatypus.com/dockerise-your-php-application-with-nginx-and-php7-fpm/)
- [Making your dockerised PHP application even better](http://geekyplatypus.com/making-your-dockerised-php-application-even-better/)
- [Docker for PHP developers](http://www.newmediacampaigns.com/blog/docker-for-php-developers)## Commands
```sh
# list images/containers
docker image ls
docker container ls# run docker containers
docker-compose up# run docker containers in detached mode
docker-compose up -d# re-build images
docker-compose up --build# start containers
docker-compose start# stop containers
docker-compose stop# stop and delete containers
docker-compose down# view containers logs
docker-compose logs
```