Git Product home page Git Product logo

php-docker's Introduction

PHP Docker

PHP Docker stack: Centos 7, Apache, MySQL, PHP and GIT.

This was setup was designed to allow easy migration of existing applications into a docker configuration.

Requirements

What's inside

Environment and Database settings

To set your environment you need to create .env.db and .env.web these will hold all your settings like password for your database.

In your .env.db if you are only doing development you can simply just create a file with just one line. I set mine to take empty passwords but if you want to set a password you can set it as you would in production with the instructions below.

  MYSQL_ALLOW_EMPTY_PASSWORD=true

In production you will want to set more we used the following

  MYSQL_ROOT_PASSWORD=<root password>
  MYSQL_DATABASE=<database name>
  MYSQL_USER=<username>
  MYSQL_PASSWORD=<user password>

In your .env.web you will want to set your timezone for example I have set mine to the US Eastern.

  TZ=America/New_York

Running

Set up a Docker Machine and then run:

$ docker-compose up

Setup Databases

Run the following commands to setup your database.

  • Database import

Running Bash on a container

docker exec -it web /bin/bash

Viewing your page

on your host open your browser connect to localhost:8080. There are already index.php with the a hello world example. Also if you run test.php it will show you your php info on the server. Opening db.php will test yoour database connectivity with the MYSQL container.

php-docker's People

Contributors

trmccormick avatar

Watchers

James Cloos avatar  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.