请问我该如何编写 nginx 配置,才能向远程drone-server注册drone-agent?
— translate —
How can I write nginx configuration to register drone-agent with remote drone-server?
remote docker-compose.yml
drone-server:
container_name: drone-server
image: drone/drone:0.8
restart: always
mem_limit: 512m
cpu_shares: 10
hostname: drone-server
volumes:
- ../dev-ops-repo/drone-server:/var/lib/drone/
environment:
- DRONE_OPEN=false
- DRONE_HOST=http://drone.haitanyule.com
- DRONE_SECRET=xxx
- DRONE_ADMIN=xxx
- DRONE_GOGS=true
- DRONE_GOGS_URL=http://git.haitanyule.com
- DRONE_GOGS_GIT_USERNAME=xxx
- DRONE_GOGS_GIT_PASSWORD=xxx
- DRONE_GOGS_PRIVATE_MODE=true
remote nginx.conf
server {
listen 80;
server_name drone.haitanyule.com;
location / {
proxy_pass http://drone-server:8000/;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_http_version 1.1;
proxy_buffering off;
chunked_transfer_encoding off;
}
}
local docker-compose.yml
drone-agent:
container_name: drone-agent
image: drone/agent:0.8
restart: always
mem_limit: 512m
cpu_shares: 10
hostname: drone-agent
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- DRONE_SERVER=drone-server.haitanyule.com:80
- DRONE_SECRET=xxx
command: agent