Code Monkey home page Code Monkey logo

php_dockerize's Introduction

Bash script for setting up a PHP stack with Docker

This is a Bash script that allows users to set up a PHP stack with Docker. The script prompts the user to select which database they want to use (MySQL, PostgreSQL, or MongoDB), which web server they want to use (Apache or Nginx), and whether they want to include Redis as an optional cache layer.

The script then generates a Docker Compose file based on the user's selections, which includes containers for the web server, PHP, and the selected database. If Redis is selected, an additional container is added for Redis.

The script also prompts the user to configure the virtualhost file for their selected web server, which is then included as a volume in the Docker Compose file.

Usage

To use this script, follow these steps:

  1. Clone the repository in your project root
git clone https://github.com/kpanuragh/php_dockerize.git
  1. Open your terminal
 cd php_dockerize
  1. Run the following command to make the script executable:
chmod +x generate.sh
  1. Run the script by typing the following command:
bash generate.sh
  1. Follow the prompts to select your desired database, web server, and Redis configuration.
  2. Review the generated Docker Compose file and virtualhost file.
  3. Run the Docker Compose file using the following command:
docker-compose up -d
  1. Verify that the containers are running by typing the following command:
docker-compose ps

Requirements

use this script, you will need to have Docker installed on your machine.

Customization

This script can be customized to support additional databases or web servers by modifying the docker-compose.yml file and adding the necessary configuration files for the virtualhost and container volumes.

php_dockerize's People

Contributors

kpanuragh avatar strikerlulu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.