Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/josee9988/docker-skeleton-lemp
LEMP Docker environment for PHP applications (Symfony, Laravel, PHP-like)
https://github.com/josee9988/docker-skeleton-lemp
composer-project docker docker-compose docker-laravel docker-machine docker-symfony dockerfile environment laravel laravel-framework lemp lemp-stack mysql mysql-database nginx php phpmyadmin phpmyadmin-docker symfony symfony-application
Last synced: 8 days ago
JSON representation
LEMP Docker environment for PHP applications (Symfony, Laravel, PHP-like)
- Host: GitHub
- URL: https://github.com/josee9988/docker-skeleton-lemp
- Owner: Josee9988
- License: mit
- Created: 2020-04-04T17:50:07.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-09-19T10:49:53.000Z (over 2 years ago)
- Last Synced: 2024-11-17T22:32:06.125Z (2 months ago)
- Topics: composer-project, docker, docker-compose, docker-laravel, docker-machine, docker-symfony, dockerfile, environment, laravel, laravel-framework, lemp, lemp-stack, mysql, mysql-database, nginx, php, phpmyadmin, phpmyadmin-docker, symfony, symfony-application
- Language: PHP
- Homepage:
- Size: 46.9 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: .github/SECURITY.md
- Support: .github/SUPPORT.md
Awesome Lists containing this project
README
# **Docker LEMP + PhpMyAdmin**
**Simple docker environment** that allows you to run applications such as `Symfony` `Laravel` or any custom _**PHP**-like_ project.
This **LEMP + composer** stack also includes **PhpMyAdmin** to allow you to manipulate your data even easier.
It is also shipped with _vim_, _nano_, _curl_, and many more useful tools!
**[Symfony installation guide](https://github.com/Josee9988/Docker-Skeleton-LEMP/wiki/Symfony-guide)** π₯|
**[Laravel installation guide](https://github.com/Josee9988/Docker-Skeleton-LEMP/wiki/Laravel-guide)** πCheck the **[Wiki](https://github.com/Josee9988/Docker-Skeleton-LEMP/wiki)** for further explanation.
Do you want to help us improve the environment or did you found a bug?
**[Let us know](https://github.com/Josee9988/Docker-Skeleton-LEMP/issues)**.---
# **Environment setup**
1. Clone the repository:
```bash
git clone https://github.com/Josee9988/Docker-Skeleton-LEMP.git
```
2. Go to the cloned project directory:```bash
cd Docker-Skeleton-LEMP
```3. Modify the .env environment variables as you please.
```dotenv
###> Docker-Skeleton-LEMP-Config ###
MYSQL_DATABASE=skeletondb
MYSQL_USER=dev
MYSQL_PASSWORD=1234
MYSQL_ROOT_PASSWORD=root
HTTP_PORT=80
PHPMYADMIN_PORT=9000
MYSQL_PORT=3306
APPLICATION_NAME=skeletonApp
###> Docker-Skeleton-LEMP-Config ###
```4. **Build** and test the container is successfully working
```bash
docker-compose up -d
```
- When you are done, visit the test page on the following URL: `http://localhost`
NOTE: If you change the 'HTTP_PORT' you will have to specify the port at the end of the URL.
- Visit the PhpMyAdmin page at: `http://localhost:9000` and log in: (_root/root_ or _dev/1234_)
5. **Initialize** your Symfony/Laravel/PHP app.- Copy the '_Docker-Skeleton-LEMP-Config_' .env config to your clipboard to not lose your configuration.
- Create/copy your new **Symfony/Laravel/PHP** files keeping the `/docker/` directory and the `docker-compose.yaml` file.
- Add the '_Docker-Skeleton-LEMP-Config_' .env config in your new .env file.
---# **Default** port settings
| **Service** | **Port** | **Path** |
|:----------------: |:--------: |:---------------------: |
| Nginx (Your App) | 80 | http://localhost |
| PhpMyAdmin | 9000 | http://localhost:9000 |
| MySQL | 3306 | N/A |---
# Connect with the terminal to run commands inside the container
If you want to run a specific composer or MySQL commands or any kind of command inside the container you can easily do it with:
NOTE: '_skeletonApp_' is the default application name. If you change this value in the .env file make sure to run the commands with your own project name.
- Access MySQL terminal.
```bash
docker exec -it skeletonApp-mysql bash # to access MySQL CLI
```- Access composer, and your own project.
```bash
docker exec -it skeletonApp-phpfpm bash # to run any other command inside the container
```---
# Project tree
```text
.
βββ docker
βΒ Β βββ Dockerfile
βΒ Β βββ mysql
βΒ Β βΒ Β βββ mysql-data
βΒ Β βββ nginx
βΒ Β βΒ Β βββ default.conf
βΒ Β βΒ Β βββ logs
βΒ Β βββ php
βΒ Β βββ logs
βΒ Β βββ php-ini-overrides.ini
βββ docker-compose.yaml
βββ LICENSE
βββ public
βΒ Β βββ index.php
βΒ Β βββ README.md
βββ README.md
```---
# Restart (MySQL) settings/container
If you should your MySQL environment variables you will have to re-create the docker container.
- Remove all the MySQL data
```bash
sudo rm -rfv docker/mysql/mysql-data/ && mkdir -p docker/mysql/mysql-data
```- Recreate the container
```bash
docker-compose up -d --build --force-recreate # will rebuild the container.
```
- Then, you can restart you can re-run your app as normal.```bash
docker-compose up -d
```---
### Did you enjoy the environment? Help us raise these numbers up!
[![Github followers](https://img.shields.io/github/followers/Josee9988.svg?style=social)]()
[![Github stars](https://img.shields.io/github/stars/Josee9988/Docker-Skeleton-LEMP.svg?style=social)]()
[![Github watchers](https://img.shields.io/github/watchers/Josee9988/Docker-Skeleton-LEMP.svg?style=social)]()
[![Github forks](https://img.shields.io/github/forks/Josee9988/Docker-Skeleton-LEMP.svg?style=social)]()---
> β οΈRemember that this docker environment does not guarantee a 100% effectiveness as it is being tested yet,
> and may have some issue at some point.
> Use it at your own risk and always do backups of your code.β οΈ_Made with a lot of β€οΈβ€οΈ by **[@Josee9988](https://github.com/Josee9988)**_