An open API service indexing awesome lists of open source software.

https://github.com/geowrgetudor/basicdocker

Basic docker-compose file for web developers
https://github.com/geowrgetudor/basicdocker

docker docker-compose php php-container php-docker php-docker-image php-environment

Last synced: 2 months ago
JSON representation

Basic docker-compose file for web developers

Awesome Lists containing this project

README

          

# Basic Docker DEV environment for Web Developers

Lighweight and simple. Do NOT use this in production.

## Upgrade

Note: If you were running this before and want to upgrade from PHP 7.3 to PHP 7.4 you will just need to remove the php-fpm container and rebuild it.

```
docker-compose stop
docker-compose rm
docker-compose build --no-cache
docker-compose up -d --force-recreate
```

## Packages

* PHP 7.4
* MySql 8.0
* Nginx
* phpMyAdmin
* Redis
* Composer
* Mailhog

## Installation

Clone or download this repository in your project's root folder

```bash
git clone git@github.com:zippos/basicdocker.git
```

## Usage

Copy ```.env.example``` to ```.env```.
By default the ```HOST_ROOT``` is set to the parent folder but you can set it up however you want.

Copy ```svqdocker/nginx/nginx.example``` to ```svqdocker/nginx/nginx.conf```
By default, the nginx confg loads your application from the root directory. If you want to change that, edit the ```.conf``` file.

Run
```
docker-compose up -d
```

Example for Laravel:
```
# default root path
root /application;

# laravel root path
root /application/public;
```

You can easily stop, remove and rebuild all containers with just one command.
```
./docker-rebuild.sh
```

**WARNING!** By using ```docker-rebuild.sh``` you will lose all your databases.

Exposed ports
```
localhost:8000 # webserver default
localhost:8081 # mailhog default
localhost:8080 # phpmyadmin default
```

Hostnames
```
mysql # for mysql
redis # for redis
php-fpm # for php-fpm (port 9000)
mailhog # for mail
```

MySql default user & password
```
root:root
```

Upload size limit
```
256M # phpmyadmin
100M # webserver
```

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License
[MIT](https://choosealicense.com/licenses/mit/)