Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Docker container, replace Build container with Alpine, reduce image volume #43

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions docker/50x.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<title>Error</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>An error occurred.</h1>
<p>Sorry, the page you are looking for is currently unavailable.<br/>
Please try again later.</p>
<p>If you are the system administrator of this resource then you should check
the error log for details.</p>
<p><em>Faithfully yours, nginx.</em></p>
</body>
<!DOCTYPE html>
<html>
<head>
<title>Error</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>An error occurred.</h1>
<p>Sorry, the page you are looking for is currently unavailable.<br/>
Please try again later.</p>
<p>If you are the system administrator of this resource then you should check
the error log for details.</p>
<p><em>Faithfully yours, nginx.</em></p>
</body>
</html>
104 changes: 54 additions & 50 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,50 +1,54 @@
FROM visense/debain11_slim:v1


ENV TUNNEL_PATH=/secret-tunnel-path/
ENV OVERTLS_LOG_LEVEL=debug


ARG HTTP_PORT=80
ARG HTTPS_PORT=443

ARG OVERTLS_HOST=127.0.0.1
ARG OVERTLS_PORT=10000


COPY run.sh utils.sh index.html security.conf 50x.html /

RUN echo 'export HTTP_PORT='"$HTTP_PORT" > /etc/envinit.sh && \
echo 'export HTTPS_PORT='"$HTTPS_PORT" >> /etc/envinit.sh && \
echo 'export HTTP_PORT='"$HTTP_PORT" >> /etc/envinit.sh && \
echo 'export OVERTLS_HOST='"$OVERTLS_HOST" >> /etc/envinit.sh && \
echo 'export OVERTLS_PORT='"$OVERTLS_PORT" >> /etc/envinit.sh && \
sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list && \
\cp /utils.sh /etc/utils.sh && \
apt-get update && apt-get install -y wget nginx vim && chmod +x /run.sh && mkdir -p /default/ && cd /default && \
wget -O overtls.zip https://github.com/shadowsocksr-live/overtls/releases/latest/download/overtls-x86_64-unknown-linux-musl.zip && \
unzip overtls.zip && rm -rf overtls.zip && \
rm -rf /var/lib/apt/lists/* && \
mkdir /web && \
mkdir /cert && \
cd /default && \
rm -rf /etc/nginx/sites-enabled/* && \
\cp /security.conf /etc/nginx/conf.d/ && \
chown -R www-data:www-data /web && \
chmod -R 777 /web





VOLUME ["/web"]
VOLUME ["/cert"]

USER root


EXPOSE $HTTP_PORT
EXPOSE $HTTPS_PORT


ENTRYPOINT ["/bin/bash", "run.sh"]
FROM alpine:3.17


ENV TUNNEL_PATH=/secret-tunnel-path/
ENV OVERTLS_LOG_LEVEL=debug


ARG HTTP_PORT=80
ARG HTTPS_PORT=443

ARG VERION=v0.2.8
ARG OVERTLS_HOST=127.0.0.1
ARG OVERTLS_PORT=10000
ARG SSL_KEY=privkey.pem
ARG SSL_PUBLIC=fullchain.pem

COPY run.sh utils.sh index.html 50x.html /

RUN echo 'export HTTP_PORT='"$HTTP_PORT" > /etc/envinit.sh && \
echo 'export HTTPS_PORT='"$HTTPS_PORT" >> /etc/envinit.sh && \
echo 'export HTTP_PORT='"$HTTP_PORT" >> /etc/envinit.sh && \
echo 'export OVERTLS_HOST='"$OVERTLS_HOST" >> /etc/envinit.sh && \
echo 'export OVERTLS_PORT='"$OVERTLS_PORT" >> /etc/envinit.sh && \
echo 'export SSL_KEY='"$SSL_KEY" >> /etc/envinit.sh && \
echo 'export SSL_PUBLIC='"$SSL_PUBLIC" >> /etc/envinit.sh && \
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
\cp /utils.sh /etc/utils.sh && \
apk add --update --no-cache bash unzip wget fontconfig nginx nginx-mod-stream nginx-mod-http-headers-more nginx-mod-http-lua vim && \
chmod +x /run.sh && mkdir -p /default/ && cd /default && \
wget -O overtls.zip https://github.com/ShadowsocksR-Live/overtls/releases/download/$VERION/overtls-x86_64-unknown-linux-musl.zip && \
unzip overtls.zip && rm -rf overtls.zip && \
fc-cache -f -v && \
rm -rf /var/cache/apk/* /tmp/* && \
mkdir /web && \
mkdir /cert && \
rm -rf /etc/nginx/sites-enabled/* && \
rm -rf /etc/nginx/http.d/*






VOLUME ["/web"]
VOLUME ["/cert"]

USER root


EXPOSE $HTTP_PORT
EXPOSE $HTTPS_PORT


ENTRYPOINT ["/bin/bash", "run.sh"]
15 changes: 7 additions & 8 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# overtls
docker run --restart always -p 80:80 -p 443:443 --name overtls -e TUNNEL_PATH=/secret-tunnel-path/ -v /cert:/cert -v /web:/web -itd registry.cn-hangzhou.aliyuncs.com/dubux/overtls:latest

# 参数说明
- `-v 证书所在目录` 一定要映射到 /cert容器目录 证书目录中必须存在私钥 `privkey.pem` 公钥 `fullchain.pem` 若名字不对请改名
- `-v web静态文件所在目录` 其中必须为包含 `index.php`, `index.html`, `index.htm`, `index.nginx-debian.html`
中任何一个为默认首页, 请自行从网上下载之后放入目录重启容器或者新建容器提前備好,映射之后的容器的目录必须是 `/web`
- `-e TUNNEL_PATH` 默认为 `/secret-tunnel-path/` 请務必修改, 否则造成迅速被 `GFW` 封鎖之后果自负
# overtls
docker run --restart always -p 80:80 -p 443:443 --name overtls -e TUNNEL_PATH=/secret-tunnel-path/ -v /cert:/cert -v /web:/web -itd chengxudong2020/overtls

# 参数说明
-v 证书所在目录 一定要映射到/cert容器目录 证书要目录中必须存在私钥privkey.pem 公钥fullchain.pem 名字不对请该名
-v web静态文件所在目录 其中必须为包含index.php index.html index.htm index.nginx-debian.html 任何一个为默认首页 请自己从网上下载之后放入目录重启容器或者新建容器提前放好,映射之后的容器的目录必须是/web
-e TUNNEL_PATH 默认为 /secret-tunnel-path/ 请修改 否则出现任何后果自负
46 changes: 23 additions & 23 deletions docker/index.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
Loading
Loading