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

View File

@@ -1,17 +0,0 @@
FROM alpine:latest
ENV CONFIG='https://raw.githubusercontent.com/ircfspace/warpsub/main/export/warp#WARP%20(IRCF)'
ENV VERSION=v0.17.8
WORKDIR /opt
RUN apk add wget tar gzip libc6-compat
RUN export ARCH=$(apk --print-arch) && if [ "$ARCH" = "i386" ]; then ARCH="386"; elif [ "$ARCH" = "x86_64" ]; then ARCH="amd64"; fi && wget https://github.com/hiddify/hiddify-next-core/releases/download/${VERSION}/hiddify-cli-linux-$ARCH.tar.gz -O hiddify-cli.tar.gz
RUN tar -xzf hiddify-cli.tar.gz && rm hiddify-cli.tar.gz
COPY hiddify.sh .
COPY hiddify.json .
RUN chmod +x hiddify.sh
EXPOSE 2334
EXPOSE 6756
EXPOSE 6450
ENTRYPOINT [ "/opt/hiddify.sh" ]

View File

@@ -1,3 +1,4 @@
.ONESHELL:
PRODUCT_NAME=libcore
BASENAME=$(PRODUCT_NAME)
BINDIR=bin
@@ -105,6 +106,7 @@ release: # Create a new tag for release.
echo "version: $${VERSION_STR}+$${BUILD_NUMBER}" && \
sed -i -e "s|<key>CFBundleVersion</key>\s*<string>[^<]*</string>|<key>CFBundleVersion</key><string>$${VERSION_STR}</string>|" Info.plist &&\
sed -i -e "s|<key>CFBundleShortVersionString</key>\s*<string>[^<]*</string>|<key>CFBundleShortVersionString</key><string>$${VERSION_STR}</string>|" Info.plist &&\
sed -i "s|ENV VERSION=.*|ENV VERSION=v$${TAG}|g" docker/Dockerfile && \
git add Info.plist && \
git commit -m "release: version $${TAG}" && \
echo "creating git tag : v$${TAG}" && \

View File

@@ -97,7 +97,7 @@ func DefaultConfigOptions() *ConfigOptions {
},
InboundOptions: InboundOptions{
EnableTun: false,
SetSystemProxy: true,
SetSystemProxy: false,
MixedPort: 2334,
LocalDnsPort: 16450,
MTU: 9000,

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"]

View File

@@ -1,41 +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"
{
"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

View File

@@ -1,2 +0,0 @@
#!/bin/sh
/opt/HiddifyCli run --config $CONFIG -h /opt/hiddify.json