Update Dockerfile
Browse files- Dockerfile +27 -18
Dockerfile
CHANGED
|
@@ -1,30 +1,39 @@
|
|
| 1 |
FROM mcr.microsoft.com/dotnet/sdk:8.0
|
| 2 |
WORKDIR /app
|
| 3 |
|
|
|
|
| 4 |
RUN apt-get update && apt-get install -y python3 python3-pip wget unzip curl
|
| 5 |
|
| 6 |
COPY requirements.txt .
|
| 7 |
RUN pip3 install --no-cache-dir -r requirements.txt --break-system-packages
|
| 8 |
|
| 9 |
-
# API
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
unzip -q umt.zip -d umt && \
|
| 27 |
-
rm umt.zip && \
|
| 28 |
find umt -type f -iname "UndertaleModCli*" -exec chmod +x {} \;
|
| 29 |
|
| 30 |
COPY . .
|
|
|
|
| 1 |
FROM mcr.microsoft.com/dotnet/sdk:8.0
|
| 2 |
WORKDIR /app
|
| 3 |
|
| 4 |
+
# Gerekli ağ araçlarını kuruyoruz
|
| 5 |
RUN apt-get update && apt-get install -y python3 python3-pip wget unzip curl
|
| 6 |
|
| 7 |
COPY requirements.txt .
|
| 8 |
RUN pip3 install --no-cache-dir -r requirements.txt --break-system-packages
|
| 9 |
|
| 10 |
+
# API Limitlerine veya Bash sözdizimi hatalarına takılmamak için betiği bir DOSYAYA yazıyoruz.
|
| 11 |
+
# (\x22 kodu, tırnak işareti (") çakışmasını engellemek için kullanılan zekice bir hex hilesidir)
|
| 12 |
+
RUN echo 'import urllib.request, re, sys\n\
|
| 13 |
+
headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"}\n\
|
| 14 |
+
urls_to_try = ["https://github.com/UnderminersTeam/UndertaleModTool/releases/expanded_assets/bleeding-edge", "https://github.com/UnderminersTeam/UndertaleModTool/releases"]\n\
|
| 15 |
+
for page_url in urls_to_try:\n\
|
| 16 |
+
try:\n\
|
| 17 |
+
req = urllib.request.Request(page_url, headers=headers)\n\
|
| 18 |
+
html = urllib.request.urlopen(req).read().decode("utf-8")\n\
|
| 19 |
+
links = re.findall(r"/UnderminersTeam/UndertaleModTool/releases/download/[^\x22]+\.zip", html)\n\
|
| 20 |
+
linux_links = [l for l in links if "linux" in l.lower() or "ubuntu" in l.lower()]\n\
|
| 21 |
+
if linux_links:\n\
|
| 22 |
+
print("https://github.com" + linux_links[0])\n\
|
| 23 |
+
sys.exit(0)\n\
|
| 24 |
+
except Exception:\n\
|
| 25 |
+
pass\n\
|
| 26 |
+
sys.exit(1)\n\
|
| 27 |
+
' > get_url.py
|
| 28 |
+
|
| 29 |
+
# Oluşturduğumuz betiği çalıştır, linki kesin olarak al ve indir
|
| 30 |
+
RUN DOWNLOAD_URL=$(python3 get_url.py) && \
|
| 31 |
+
echo "=========================================" && \
|
| 32 |
+
echo "BULUNAN KESIN LINK: $DOWNLOAD_URL" && \
|
| 33 |
+
echo "=========================================" && \
|
| 34 |
+
wget -qO umt.zip "$DOWNLOAD_URL" && \
|
| 35 |
unzip -q umt.zip -d umt && \
|
| 36 |
+
rm umt.zip get_url.py && \
|
| 37 |
find umt -type f -iname "UndertaleModCli*" -exec chmod +x {} \;
|
| 38 |
|
| 39 |
COPY . .
|