Laradock-like development and production environment based on Docker containers with Docker Compose.
Images build with alpine (not all).
Easy to start from an PHP project.
Tested on Debian 9 / 10
git clone https://github.com/mayocream/Runtime.git
curl -sSL https://get.docker.com/ | sh
apt update
apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/debian/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/debian $(lsb_release -cs) stable"
apt update
apt-cache policy docker-ce
apt install docker-ce
check docker status systemctl status docker
from Github:
curl -L https://github.com/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
from DaoCloud (China mirror source)
curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
then:
chmod +x /usr/local/bin/docker-compose
edit /etc/docker/daemon.json
{
"registry-mirrors": [
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com"
]
}
systemctl daemon-reload
systemctl restart docker
edit docker-compose.yml file, comment the part you don't need.
cp docker-compose.example.yml docker-compose.yml
nano docker-compose.yml
edit .env file.
cp env-example .env
nano .env
check the permissions of work folders.
mkdir /var/www # Your work folder.
chmod 777 -R /var/www
chmod 777 -R /var/runtime # Repo download path
docker-compose up -d
Change Docker default hub mirror and expose docker's control port.
edit /etc/docker/daemon.json
{
"registry-mirrors": [
"https://610w9y8k.mirror.aliyuncs.com"
],
"hosts": [
"tcp://0.0.0.0:2375",
"unix:///var/run/docker.sock"
]
}
Q: Database won't work on Shared Folders on Windows.
A: Known as Windows' file system and permission problem, there's no a common solution.