Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/toa-anakin/symfony-webapp-docker-dev
Docker setup for latest Symfony web apps with Nginx, MySQL, phpMyAdmin
https://github.com/toa-anakin/symfony-webapp-docker-dev
composer docker docker-symfony docker-symfony6 mysql mysql8-0 mysql80 nginx php php8-2 php82 phpmyadmin symfony symfony-docker symfony-docker-template symfony-dockerize symfony6-docker symfony63
Last synced: 3 months ago
JSON representation
Docker setup for latest Symfony web apps with Nginx, MySQL, phpMyAdmin
- Host: GitHub
- URL: https://github.com/toa-anakin/symfony-webapp-docker-dev
- Owner: TOA-Anakin
- License: mit
- Created: 2023-11-30T02:49:36.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-02T02:24:06.000Z (about 1 year ago)
- Last Synced: 2024-09-29T20:04:25.635Z (4 months ago)
- Topics: composer, docker, docker-symfony, docker-symfony6, mysql, mysql8-0, mysql80, nginx, php, php8-2, php82, phpmyadmin, symfony, symfony-docker, symfony-docker-template, symfony-dockerize, symfony6-docker, symfony63
- Language: Dockerfile
- Homepage:
- Size: 7.81 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Docker Setup for Symfony 6.3.* Web Apps
Docker containers for traditional Symfony 6.3.* web apps, i.e., apps that you would usually create using the `--webapp` Symfony CLI option or the `composer require webapp` command.
## What is inside
- **Nginx** webserver
- **PHP 8.2** (with `composer`)
- **MySQL 8.0**
- **phpMyAdmin**## Local dev guide (Linux)
1. Clone the repo:
```.sh
git clone https://github.com/TOA-Anakin/symfony-webapp-docker-dev.git
```
2. Rename the cloned repo as desired:
```.sh
mv symfony-webapp-docker-dev your_project_name
```
3. Find your user ID using the `id -u` command and update the `.docker/.env` file accordingly.
4. `cd` into the `.docker` directory and build the Docker containers:
```.sh
cd your_project_name/.docker
docker compose up -d --build
```
Before the end of the process you should see a list of newly created (now running) containers:
```.sh
[+] Running 6/6
✔ Network symfony_webapp_docker_symfony_app
Created 0.1s
✔ Volume "symfony_webapp_docker_db_app"
Created 0.0s
✔ Container symfony_webapp_docker-phpmyadmin-1
Started 0.2s
✔ Container symfony_webapp_docker-php-1
Started 0.2s
✔ Container symfony_webapp_docker-db-1
Started 0.2s
✔ Container symfony_webapp_docker-nginx-1
Started 0.2s
```
5. Open the terminal of the PHP container (mine is named `symfony_webapp_docker-php-1`) and create a Symfony skeleton project using `composer`:
```.sh
docker exec -it symfony_webapp_docker-php-1 bash
composer create-project symfony/skeleton:"6.3.*" tmp_dir
```
Move the contents of `temp_dir` into the project root:
```.sh
mv tmp_dir/* . && mv tmp_dir/.[!.]* . && rmdir tmp_dir
```
Install Symfony web app packages:
```.sh
composer require webapp
```
***Note:*** If you are prompted with a question `Do you want to include Docker configuration from recipes?`, answer `n [No]`.
6. Access your Symfony web app at http://localhost, phpMyAdmin is accessible at http://localhost:8081