Public Repository

Last pushed: 8 months ago
Short Description
安裝LAMP與Laravel的環境,可執行Laravel 5.4以上的版本
Full Description

日期:2017.03.02

系統:
Linux: ubuntu v16.04.2
Apache v2.4.18
MySQL v5.7.17
PHP Version v7.0.15
phpMyAdmin v4.6.6

製作Dockerfile
$ docker build -t akilachen/laravel

啟動akilachen/laravel
$ docker run -d --rm --name=laravel -v /Users/akilachen/htdocs:/var/www/html -v /Users/akilachen/MySQL/db:/var/lib/mysql -p 80:80 -p 3306:3306 -t akilachen/laravel

進入akilachen/laravel命令模式
$ docker exec -ti laravel /bin/bash

測試網站
http://localhost

設定mysql的root密碼,才可使用phpMyAdmin
$ mysql

use mysql;
UPDATE user SET Password=PASSWORD("root密碼") WHERE User='root';
flush privileges;
exit;

測試phpMyAdmin
http://localhost/phpMyAdmin

調整虛擬主機,指到Laravel的public目錄
vi /etc/apache2/sites-available/app.local.conf

安裝Laravel專案

RUN useradd -ms /bin/bash akilachen

USER akilachen

WORKDIR /home/akilachen

export PATH=$HOME/.composer/vendor/bin:$PATH
composer global require "laravel/installer"
composer create-project --prefer-dist laravel/laravel change_to_your_project_name_here

Docker Pull Command
Owner
akilachen