通过 Git 提交 ID 访问您的 Docker 化 Web 应用程序的最简单代理服务。
The simplest proxy service to access your Dockerized web application by Git commit-id, branch or tag.
You can build and run your web application as a Docker container just to access
http://.pool.dev for example.
Vagrantfile is configured to have docker so you don't have to care about it if you try to run on VagrantDockerfile on root of the repositoryDockerfile is for a container which the application is going to be runYou can run pool on your local Vagrant environment also.
It needs to install vagrant dns plugin before vagrant up. Just run after vagrant was installed:
vagrant plugin install vagrant-dns
vagrant dns --install
vagrant dns --startthen run:
vagrant upYou can give some configuration to pool in Vagrantfile.
Currently we some configurations for pool.
pool kills containers if the number of containers are over than this number automaticallyYou can rewrite Vagrantfile like:
…sh #!/bin/sh
yum install -y git yum install -y docker
service docker stop curl https://get.docker.com/builds/Linux/x86_64/docker-latest -o /tmp/docker chmod +x /tmp/docker cp /tmp/docker /usr/bin/docker service docker start
git clone https://github.com/mookjp/pool.git /app
pool image and run to execute init_host_server script./app/scripts/init_host_server "https://github.com/mookjp/flaskapp.git" 5 "dev.prevs.io"
…bash core@pool ~ $ cat/app/docker/pool/keys/id_rsa
-----BEGIN RSA PRIVATE KEY----- .......... -----END RSA PRIVATE KEY----- EOS
core@pool ~ $ sudo /app/scripts/init_host_server
core@pool ~ $ sudo docker exec -it pool bash
[pool container]# ls -l /app/keys/id_rsa
## How it works
The part of proxy in `pool` accesses your Git repository with commit id given as
hostname then checkout source with Dockerfile.
Dockerfile should be on the root of the repository.
After checkout files, the container will be built by the Dockerfile
and port is linked with front automatically. All you can do is just to access
by URL like `http://.pool.dev`.
`pool` consists of two modules; proxy hook and container builder.
`handlers/hook.rb` handles HTTP request as proxy. This is a hook script of
[matsumoto-r/mod_mruby](https://github.com/matsumoto-r/mod_mruby).
It forwards port which Docker container was assigned by Git-commit-id.
If there's no container which corresponds to Git-commit-id, `build_server` works to
build Docker image then runs it.
`build_server` sends build log so that you can confirm the status of build process
while waiting.
If there is another proccess to build and run container, `pool` locks to run other
process and waits until lock is over.
## Contributors
[Contributors](https://github.com/mookjp/pool/contributors)暂无开放 Issues,或尚未同步最近议题。