Skip to content

This repository provides a well-structured and configurable Docker setup for a PHP application With Ubuntu, PHP 8.2, MySQL and Redis.

License

Notifications You must be signed in to change notification settings

mrtolouei/docker-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Dockerized PHP Application with Ubuntu, PHP 8.2, MySQL, and Redis

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.

Key Features

  • 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.

Target Audience

  • 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.

Getting Started

  1. Clone this repository:
git clone https://github.com/your-username/php-docker-app.git
  1. 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.
  1. Build and run:
docker-compose up -d

This will build and start all containers in the background.

Customization

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.

Contribution

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.

License

This package is open-source software licensed under the MIT license.

About

This repository provides a well-structured and configurable Docker setup for a PHP application With Ubuntu, PHP 8.2, MySQL and Redis.

Topics

Resources

License

Stars

Watchers

Forks