yzwd commited on
Commit
e4ca8c9
1 Parent(s): 838ff8d

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +34 -0
Dockerfile ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM alpine
2
+
3
+ WORKDIR /opt/app
4
+
5
+ RUN apk add --no-cache nodejs curl tzdata
6
+
7
+ ENV TIME_ZONE=Asia/Shanghai
8
+
9
+ RUN cp /usr/share/zoneinfo/$TIME_ZONE /etc/localtime && echo $TIME_ZONE > /etc/timezone
10
+
11
+ # RUN apk del tzdata # BUG: https://github.com/gliderlabs/docker-alpine/issues/136#issuecomment-612751142
12
+
13
+ ADD https://github.com/sub-store-org/Sub-Store/releases/latest/download/sub-store.bundle.js /opt/app/sub-store.bundle.js
14
+
15
+ ADD https://github.com/sub-store-org/Sub-Store-Front-End/releases/latest/download/dist.zip /opt/app/dist.zip
16
+
17
+ RUN unzip dist.zip; mv dist frontend; rm dist.zip
18
+
19
+ ADD https://github.com/xream/http-meta/releases/latest/download/http-meta.bundle.js /opt/app/http-meta.bundle.js
20
+
21
+ ADD https://github.com/xream/http-meta/releases/latest/download/tpl.yaml /opt/app/data/tpl.yaml
22
+
23
+ RUN version=$(curl -s -L --connect-timeout 5 --max-time 10 --retry 2 --retry-delay 0 --retry-max-time 20 'https://github.com/MetaCubeX/mihomo/releases/download/Prerelease-Alpha/version.txt') && \
24
+ arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64-compatible/) && \
25
+ url="https://github.com/MetaCubeX/mihomo/releases/download/Prerelease-Alpha/mihomo-linux-$arch-$version.gz" && \
26
+ curl -s -L --connect-timeout 5 --max-time 10 --retry 2 --retry-delay 0 --retry-max-time 20 "$url" -o /opt/app/data/http-meta.gz && \
27
+ gunzip /opt/app/data/http-meta.gz && \
28
+ rm -rf /opt/app/data/http-meta.gz
29
+
30
+ RUN chmod 777 -R /opt/app
31
+
32
+ CMD mkdir -p /opt/app/data; cd /opt/app/data; \
33
+ META_FOLDER=/opt/app/data HOST=:: PORT=9876 node /opt/app/http-meta.bundle.js > /opt/app/data/http-meta.log 2>&1 & echo "HTTP-META is running..."; \
34
+ SUB_STORE_BACKEND_API_HOST=:: SUB_STORE_FRONTEND_HOST=:: SUB_STORE_FRONTEND_PORT=7860 SUB_STORE_FRONTEND_PATH=/opt/app/frontend SUB_STORE_DATA_BASE_PATH=/opt/app/data node /opt/app/sub-store.bundle.js