- Docker
- Docker Compose
- Git
- Clone or download this repo
git clone [email protected]:dwiwinarno911/phpdocker.git docker-workspace
- Go to cloned folder
cd r-workspace
- Copy environtment file
cp .env.example .env
- Set your environtment in .env file. You can turn specify port, restart behaviour, and mysql credential.
- All set! Run docker
docker-compose up
- Wait until the process is done, and Voila!
- Congratulation
You can clone your CR3 app to directory ./web, based on nginx vhost in this repository each app have these following directory:
- CR3: ./web/cr3 (
git clone [email protected]:rschooltoday/rsp-crmnscu.git cr3
)
To use php version on this docker , you can change nginx vhost conf on etc/nginx/default.conf
this docker have 4 php version
- php 5.6
- php 7.0
- php 7.4
- php 8.0
You can use by change this pass on vhost
- php 5.6
fastcgi_pass php5:9000;
- php 7.0
fastcgi_pass php70:9000;
- php 7.4
fastcgi_pass php74:9000;
- php 8.0
fastcgi_pass php8:9000;
To connect database on this docker you can use this config on yout app
- MySQL 5.6
- host = db
- username = root
- password = password
- port = 3306
- MySQL 5.7
- host = db
- username = root
- password = password
- port = 3306
Also you can connect this connection via SQL Yog or Another sql management app via
- MySQL 5.6
- host = localhost
- username = root
- password = password
- port = 3306
- MySQL 5.7
- host = localhost
- username = root
- password = password
- port = 3307