Neon-AI commited on
Commit
3f24fc3
·
verified ·
1 Parent(s): 54220cf

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -24
Dockerfile CHANGED
@@ -1,41 +1,26 @@
1
  # syntax=docker/dockerfile:1.6
2
  FROM node:20-slim
3
 
4
- # 1️⃣ Install git, curl, ca-certificates
5
  RUN apt-get update && \
6
- apt-get install -y git curl ca-certificates && \
7
  rm -rf /var/lib/apt/lists/*
8
 
9
- # 2️⃣ Install Git LFS manually
10
- RUN curl -sSL https://github.com/git-lfs/git-lfs/releases/download/v3.4.0/git-lfs-linux-amd64-v3.4.0.tar.gz \
11
- | tar -xz -C /tmp && \
12
- mv /tmp/git-lfs-3.4.0/git-lfs /usr/local/bin/ && \
13
- chmod +x /usr/local/bin/git-lfs && \
14
- git lfs install
15
-
16
- # 3️⃣ Set working directory
17
  WORKDIR /app
18
 
19
- # 4️⃣ Clone private GitHub repo securely
20
  RUN --mount=type=secret,id=GH_TOKEN \
21
  git clone https://$(cat /run/secrets/GH_TOKEN)@github.com/IMaduwike/telebot-api.git temp
22
 
23
- WORKDIR /app/temp
24
-
25
- # 5️⃣ Pull LFS files (ensures binary is real)
26
- RUN git lfs pull
27
-
28
- # 6️⃣ Copy everything to /app, then move binary
29
- RUN cp -r * /app/ && \
30
- mv /app/telegram-bot-api /usr/local/bin/telegram-bot-api && \
31
  chmod +x /usr/local/bin/telegram-bot-api && \
32
- rm -rf /app/temp
33
-
34
- WORKDIR /app
35
 
36
- # 7️⃣ Install Node dependencies
37
  RUN npm install
38
 
39
- # 8️⃣ Expose port and start
40
  EXPOSE 7860
41
  CMD ["./start.sh"]
 
1
  # syntax=docker/dockerfile:1.6
2
  FROM node:20-slim
3
 
4
+ # Install git and ca-certificates
5
  RUN apt-get update && \
6
+ apt-get install -y git ca-certificates && \
7
  rm -rf /var/lib/apt/lists/*
8
 
 
 
 
 
 
 
 
 
9
  WORKDIR /app
10
 
11
+ # Clone private repo using secret token
12
  RUN --mount=type=secret,id=GH_TOKEN \
13
  git clone https://$(cat /run/secrets/GH_TOKEN)@github.com/IMaduwike/telebot-api.git temp
14
 
15
+ # Move binary to /usr/local/bin and app files to /app
16
+ RUN mv temp/telegram-bot-api /usr/local/bin/telegram-bot-api && \
 
 
 
 
 
 
17
  chmod +x /usr/local/bin/telegram-bot-api && \
18
+ mv temp/server.js temp/package.json temp/start.sh ./ && \
19
+ chmod +x start.sh && \
20
+ rm -rf temp
21
 
22
+ # Install Node dependencies
23
  RUN npm install
24
 
 
25
  EXPOSE 7860
26
  CMD ["./start.sh"]