1.編輯docker目錄下workerspace/Dockerfile 新增EXPOSE埠號;
2.編輯docker目錄下docker-compose.yml workspace -ports 新增"埠號:埠號";
3.laravel專案根目錄.env 新增
LARAVELS_LISTEN_IP=workspace/0.0.0.0
LARAVELS_DAEMONIZE=true
4.nginx/sites/虛擬主機目錄配置新增
upstream danmu {\
server workspace:埠號 weight=5 max_fails=3 fail_timeout=30s; keepalive 16;
}
5.最後重新構建並重啟 Laradock 相關服務
docker-compose build workspace nginx
docker-compose down
docker-compose up -d nginx mysql redis memcachedps
:獲取容器IP地址docker ps
然後,檢視活動容器的列表
docker inspect YOUR_WORKSPACE_CONTAINER_ID_HERE