This repository has been archived by the owner on Dec 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 773
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Starnop <[email protected]>
- Loading branch information
Showing
7 changed files
with
199 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM golang:1.10.4-alpine as builder | ||
|
||
WORKDIR /go/src/github.com/dragonflyoss/Dragonfly | ||
RUN apk --no-cache add bash make gcc libc-dev git | ||
|
||
COPY . /go/src/github.com/dragonflyoss/Dragonfly | ||
|
||
# go build supernode. | ||
# write the resulting executable to the dir /opt/dragonfly/df-supernode. | ||
RUN make build-supernode && make install-supernode | ||
|
||
FROM nginx:1.16-alpine | ||
|
||
RUN apk --no-cache add ca-certificates bash | ||
|
||
COPY --from=builder /go/src/github.com/dragonflyoss/Dragonfly/hack/supernode-nginx.conf /etc/nginx/nginx.conf | ||
COPY --from=builder /opt/dragonfly/df-supernode/supernode /opt/dragonfly/df-supernode/supernode | ||
|
||
# supernode will listen 8001,8002 in default. | ||
EXPOSE 8001 8002 | ||
|
||
ENTRYPOINT [ "sh", "-c", "nginx && /opt/dragonfly/df-supernode/supernode" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
DF_VERSION=${DF_VERSION:-"latest"} | ||
curDir=$(cd "$(dirname "$0")" && pwd) | ||
cd "${curDir}/../" || return | ||
|
||
docker-build::build-dfclient(){ | ||
docker build -t dfclient:"${DF_VERSION}" -f Dockerfile . | ||
} | ||
|
||
docker-build::build-supernode(){ | ||
docker build -t supernode:"${DF_VERSION}" -f Dockerfile.supernode . | ||
} | ||
|
||
main() { | ||
case "$1" in | ||
dfclient) | ||
docker-build::build-dfclient | ||
;; | ||
supernode) | ||
docker-build::build-supernode | ||
;; | ||
*) | ||
docker-build::build-dfclient | ||
docker-build::build-supernode | ||
;; | ||
esac | ||
} | ||
|
||
main "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
worker_rlimit_nofile 100000; | ||
|
||
events { | ||
use epoll; | ||
worker_connections 20480; | ||
} | ||
|
||
http { | ||
include mime.types; | ||
default_type application/octet-stream; | ||
root /home/admin/cai/htdocs; | ||
sendfile on; | ||
tcp_nopush on; | ||
|
||
server_tokens off; | ||
keepalive_timeout 5; | ||
|
||
client_header_timeout 1m; | ||
send_timeout 1m; | ||
client_max_body_size 3m; | ||
|
||
index index.html index.htm; | ||
access_log off; | ||
log_not_found off; | ||
|
||
gzip on; | ||
gzip_http_version 1.0; | ||
gzip_comp_level 6; | ||
gzip_min_length 1024; | ||
gzip_proxied any; | ||
gzip_vary on; | ||
gzip_disable msie6; | ||
gzip_buffers 96 8k; | ||
gzip_types text/xml text/plain text/css application/javascript application/x-javascript application/rss+xml application/json; | ||
|
||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header Web-Server-Type nginx; | ||
proxy_set_header WL-Proxy-Client-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_redirect off; | ||
proxy_buffers 128 8k; | ||
proxy_intercept_errors on; | ||
|
||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
server { | ||
listen 8001; | ||
location / { | ||
root /home/admin/supernode/repo; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
What is the reason of removing nginx reverse proxy from the configuration?
P.S. In early version, nginx acts as both reverse proxy and file server which confuses me for a while, and recently I've found proxy config has been removed, but I cannot see the change in any documents.
As I cannot find the commit making the change, I ask in this commit.