refactor docker

This commit is contained in:
Hiddify
2024-03-14 23:44:36 +01:00
parent ec9efac57c
commit 16a5191d2c
8 changed files with 88 additions and 60 deletions

25
docker/Dockerfile Normal file
View File

@@ -0,0 +1,25 @@
FROM alpine:latest
ENV CONFIG='https://raw.githubusercontent.com/ircfspace/warpsub/main/export/warp#WARP%20(IRCF)'
ENV VERSION=0.17.8
WORKDIR /hiddify
RUN apk add wget tar gzip libc6-compat
RUN case "$(apk --print-arch)" in \
x86_64) ARCH=amd64 ;; \
i386) ARCH=386 ;; \
armv7l) ARCH=arm ;; \
aarch64) ARCH=arm64 ;; \
*) echo "Unsupported architecture: $(apk --print-arch) $(uname -m)" && exit 1 ;; \
esac && \
curl -l -o hiddify-cli.tar.gz https://github.com/hiddify/hiddify-next-core/releases/download/${VERSION}/hiddify-cli-linux-$ARCH.tar.gz && \
tar -xzf hiddify-cli.tar.gz && rm hiddify-cli.tar.gz
COPY hiddify.sh .
RUN chmod +x hiddify.sh
COPY hiddify.json ./data/
EXPOSE 2334
EXPOSE 6756
EXPOSE 6450
ENTRYPOINT [ "/opt/hiddify.sh" ]

14
docker/docker-compose.yml Normal file
View File

@@ -0,0 +1,14 @@
version: '3.8'
services:
hiddify:
image: ghcr.io/hiddify/hiddify-next-core/cli:latest
ports:
- "2334:2334"
- "6756:6756"
- "6450:6450"
environment:
CONFIG: "https://raw.githubusercontent.com/ircfspace/warpsub/main/export/warp#WARP%20(IRCF)"
volumes:
- ./data/:/hiddify/data/
command: ["/opt/hiddify.sh"]

41
docker/hiddify.json Normal file
View File

@@ -0,0 +1,41 @@
{
"service-mode": "proxy",
"log-level": "info",
"resolve-destination": true,
"ipv6-mode": "prefer_ipv4",
"remote-dns-address": "tcp://1.1.1.1",
"remote-dns-domain-strategy": "",
"direct-dns-address": "1.1.1.1",
"direct-dns-domain-strategy": "",
"mixed-port": 2334,
"local-dns-port": 6450,
"tun-implementation": "mixed",
"mtu": 9000,
"strict-route": false,
"connection-test-url": "https://www.gstatic.com/generate_204",
"url-test-interval": 600,
"enable-clash-api": true,
"clash-api-port": 6756,
"bypass-lan": false,
"allow-connection-from-lan": true,
"enable-fake-dns": false,
"enable-dns-routing": true,
"independent-dns-cache": true,
"enable-tls-fragment": false,
"tls-fragment-size": "20-70",
"tls-fragment-sleep": "10-30",
"enable-tls-mixed-sni-case": false,
"enable-tls-padding": false,
"tls-padding-size": "15-30",
"enable-mux": false,
"mux-padding": false,
"mux-max-streams": 4,
"mux-protocol": "h2mux",
"enable-warp": false,
"warp-detour-mode": "outbound",
"warp-license-key": "",
"warp-clean-ip": "auto",
"warp-port": 0,
"warp-noise": "5-10",
"warp-noise-delay": "20-200"
}

6
docker/hiddify.sh Normal file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
if [ -f "/opt/hiddify.json" ]; then
/hiddify/HiddifyCli run --config "$CONFIG" -h /hiddify/data/hiddify.json
else
/hiddify/HiddifyCli run --config "$CONFIG"
fi