Neon-AI commited on
Commit
3315f81
·
verified ·
1 Parent(s): 7fcaa54

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -31
Dockerfile CHANGED
@@ -1,49 +1,30 @@
1
  FROM node:20-slim
2
 
3
- # 1️⃣ Install git, curl, certificates
4
- RUN apt-get update && \
5
- apt-get install -y git curl ca-certificates && \
6
- rm -rf /var/lib/apt/lists/*
7
 
8
- # 2️⃣ Install Git LFS
9
  RUN curl -sSL https://github.com/git-lfs/git-lfs/releases/download/v3.4.0/git-lfs-linux-amd64-v3.4.0.tar.gz \
10
  | tar -xz -C /tmp && \
11
  mv /tmp/git-lfs-3.4.0/git-lfs /usr/local/bin/git-lfs && \
12
- chmod +x /usr/local/bin/git-lfs && \
13
- git lfs install
14
 
15
  WORKDIR /app
16
 
17
- # 3️⃣ Clone private repo securely using GH_TOKEN secret
18
  RUN --mount=type=secret,id=GH_TOKEN \
19
- git clone https://$(cat /run/secrets/GH_TOKEN)@github.com/IMaduwike/telebot-api.git temp
20
 
21
- WORKDIR /app/temp
22
-
23
- # 4️⃣ Pull the real binary using Git LFS
24
  RUN git lfs pull
25
 
26
- # 5️⃣ Move binary and all app files automatically
27
- # - Move telegram-bot-api binary to /usr/local/bin
28
- # - Move everything else (js, package.json, start.sh) to /app
29
- RUN find . -maxdepth 1 -type f -exec sh -c ' \
30
- for f; do \
31
- if [ "$f" = "./telegram-bot-api" ]; then \
32
- mv "$f" /usr/local/bin/telegram-bot-api && chmod +x /usr/local/bin/telegram-bot-api; \
33
- else \
34
- mv "$f" /app/; \
35
- fi; \
36
- done' sh {} +
37
-
38
- # 6️⃣ Clean up
39
- RUN rm -rf /app/temp
40
-
41
- WORKDIR /app
42
 
43
- # 7️⃣ Install Node dependencies
44
  RUN npm install
45
 
46
  EXPOSE 7860
47
 
48
- # 8️⃣ Start TDLib + Node server
49
- CMD ["bash", "./start.sh"]
 
1
  FROM node:20-slim
2
 
3
+ # Install git, curl, certificates
4
+ RUN apt-get update && apt-get install -y git curl ca-certificates && rm -rf /var/lib/apt/lists/*
 
 
5
 
6
+ # Install Git LFS
7
  RUN curl -sSL https://github.com/git-lfs/git-lfs/releases/download/v3.4.0/git-lfs-linux-amd64-v3.4.0.tar.gz \
8
  | tar -xz -C /tmp && \
9
  mv /tmp/git-lfs-3.4.0/git-lfs /usr/local/bin/git-lfs && \
10
+ chmod +x /usr/local/bin/git-lfs && git lfs install
 
11
 
12
  WORKDIR /app
13
 
14
+ # Clone repo using GH_TOKEN secret
15
  RUN --mount=type=secret,id=GH_TOKEN \
16
+ git clone https://$(cat /run/secrets/GH_TOKEN)@github.com/IMaduwike/telebot-api.git .
17
 
18
+ # Pull LFS binary
 
 
19
  RUN git lfs pull
20
 
21
+ # Move telegram-bot-api to /usr/local/bin
22
+ RUN mv telegram-bot-api /usr/local/bin/telegram-bot-api && chmod +x /usr/local/bin/telegram-bot-api
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
+ # Install Node dependencies
25
  RUN npm install
26
 
27
  EXPOSE 7860
28
 
29
+ # Start TDLib + Node server via shell
30
+ CMD ["sh", "./start.sh"]