Skip to content

Instantly share code, notes, and snippets.

一般Dockfile是不是只建議寫一個指令
那像如果要部署一個測試環境,需要有nginx、redis、php、phpunit是不是都另外寫多支dockerfile
再用link方式連結各項服務
之後再用docker compose 去部署
好像都卡在 build nginx
環境是用
Linux main 3.13.0-46-generic #77-Ubuntu SMP Mon Mar 2 18:23:39 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
用vagrant ssh 登入之後
cd 到 build-dev 目錄 執行 docker-compose up
下載完畢之後,然後就一直hang在
Attaching to builddev_nginx_1
我的docker-compose.yml 長這樣
[code]
@aloha1003
aloha1003 / gist:321211cd1ba8a5ec3bbe
Created April 2, 2015 02:26
How to access mongodb from outside
我透過docker-compose 安裝mongodb
腳本如下:
mongo:
image: aloha1003/mongo:latest
ports:
- "27017:27017"
- "28017:28017"
volumes:
- "/Volumes/MACOS/mongodb/var/mongodb:/srv/mongodb"
- "/Volumes/MACOS/log/mongodb:/var/log/mongodb"
@aloha1003
aloha1003 / CodeIginter Autoload
Created May 12, 2015 09:55
CodeIginter Autoload
/*
* Append this to the end of your application/config.php
*/
spl_autoload_extensions('.php'); // Only Autoload PHP Files
spl_autoload_register('my_autoload');
function my_autoload($classname)
{
$autoLoadDirAry = array(
APPPATH . 'libraries/',
@aloha1003
aloha1003 / python.local.conf
Created May 25, 2015 09:14
Nginx 、uwsgi 、python demo 設定
server {
listen 8080 ;
location /py/ {
access_log /var/log/nginx/py-access.log;
error_log /var/log/nginx/py-error.log error;
include /etc/nginx/uwsgi_params;
uwsgi_modifier1 9;
uwsgi_pass 127.0.0.1:9090;
}
@aloha1003
aloha1003 / app.js
Last active August 29, 2015 14:21 — forked from ralphmyw/app.js
var LINE = require('./line.js');
var line = new LINE();
var email = 'your email';
var password = 'your password';
line.login(email, password, function(error, result) {
if (error) {
return;
}
### USAGE
###
### ./ElasticSearch.sh 1.5.0 will install Elasticsearch 1.5.0
### ./ElasticSearch.sh 1.4.4 will install Elasticsearch 1.4.4
### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
### ElasticSearch version
1. find and add contacts by email or phone number (Important)
<div class="areaA">
<select ng-model="areaACountry" ng-options="citys for (citys, areaACountry) in zipCodes" ></select>
<select ng-model="areaATown"
ng-options="areas for (areas, zipcode) in areaACountry" ></select>
</div>
<div class="areaB">
<input type="checkbox" id="areaBAsAreaA" ng-checked="areaBAsAreaA()" />與AreaA相同內容<br />
<select ng-model="areaBCountry" ng-options="citys for (citys, areaBCountry) in zipCodes" ></select>
<select ng-model="areaBTown"
ng-options="areas for (areas, zipcode) in areaBCountry" ></select>
use \App\Model\ObjectForTest as ObjectForTest;
class Main() {
function test() {
$ary = [];
array_map(array('ObjectForTest', 'fun'), $ary); //回報錯誤
array_map(array('\App\Model\ObjectForTest', 'fun'), $ary); //正常
}
}