This project demonstrates a dockerized application using Symfony, Angular, and MySQL. It includes a test site built with Symfony and Twig, as well as a small Angular application.
- Symfony application: Located in the
appdirectory - Angular application: Located in the
panierdirectory - Docker configuration files: In the root directory and
dockersubdirectories
- Docker
- Docker Compose
-
Clone this repository:
git clone https://github.com/timlapov/symfony-angular-dockerization.git cd symfony-angular-dockerization -
Create a
.env.localfile in the root directory and add any necessary environment-specific configurations. I propose an .env file with test data. -
Build and start the Docker containers:
docker-compose up -d -
The applications will be available at:
- Symfony app: http://localhost:8081
- Angular app: http://localhost:4200
- PHPMyAdmin: http://localhost:8080
- nginx: Web server for the Symfony application
- php-fpm: PHP-FPM service for Symfony
- php-cli: PHP CLI service for Composer and other command-line tasks
- mysql: MySQL database server
- phpmyadmin: PHPMyAdmin for database management
- angular-1: Angular application
- backup: Automated daily database backups
The main configuration is in the docker-compose.yml file. Environment variables are stored in the .env file.
Note: For demonstration purposes, database credentials and other sensitive information are included in the repository. In a production environment, these should be kept secure and not committed to version control.
- The MySQL database is automatically set up with the credentials specified in the
.envfile. - PHPMyAdmin is configured for automatic login.
- Daily backups are created and stored in the
backupsdirectory.
- Symfony files are located in the
appdirectory and are mounted as a volume in the Docker containers. - The Angular application is in the
panierdirectory and has its own Dockerfile for building and serving the app.
You can modify the .env file to change project names, database credentials, and other configuration options.
This project is a demonstration of Docker containerization and includes exposed database credentials and automatic PHPMyAdmin login for ease of use. In a production environment, ensure proper security measures are implemented, including:
- Secure handling of credentials
- Proper network isolation
- Regular security audits
Feel free to fork this repository and submit pull requests for any improvements or fixes.
This project is open-source and available under the MIT License.