This repository provides a Docker configuration for running a PHP application on Ubuntu 22.04 LTS with PHP 8.2, MySQL server, and Redis cache. It leverages Docker Compose for a streamlined and modular setup.
- Pre-configured environment: Get started quickly with a ready-to-use foundation.
- Docker Compose: Easily manage individual components and scale seamlessly.
- Security-conscious: Adheres to security best practices and allows further customization.
- Customizable: Extend the base configuration to match your project's requirements.
- Version control: Leverage Git for collaboration and version tracking.
- evelopers seeking a modern and maintainable Dockerized PHP application setup.
- DevOps professionals looking for a foundation for scalable deployments.
- Anyone exploring Docker and containerization for PHP development.
- Clone this repository:
git clone https://github.com/your-username/php-docker-app.git
- Set up environment variables:
Create a
.env
file in the project root directory and configure the following variables:
MYSQL_ROOT_PASSWORD
: Set a strong password for the MySQL root user.MYSQL_DATABASE
: Name of your MySQL database.MYSQL_USER
: MySQL username with access to the database.MYSQL_PASSWORD
: Password for the MySQL user.REDIS_PASSWORD
: Set a password for the Redis server.- (Optional) Additional configuration variables can be found in the docker-compose.yml file.
- Build and run:
docker-compose up -d
This will build and start all containers in the background.
You can customize the application by:
- Modifying Dockerfile settings.
- Adding additional services or configurations to docker-compose.yml.
- Checking out the .env.example file for additional configuration options.
Contributions are welcome! If you have ideas for new features, improvements, or if you encounter any issues, feel free to open an issue or submit a pull request.
This package is open-source software licensed under the MIT license.