telebot-api / Dockerfile
Neon-AI's picture
Update Dockerfile
06b754f verified
raw
history blame
1.67 kB
# syntax=docker/dockerfile:1.4
FROM node:20-slim
# -----------------------------
# Install system dependencies
# -----------------------------
RUN apt-get update && \
apt-get install -y git curl ca-certificates && \
rm -rf /var/lib/apt/lists/*
# -----------------------------
# Install Git LFS
# -----------------------------
RUN curl -sSL https://github.com/git-lfs/git-lfs/releases/download/v3.4.0/git-lfs-linux-amd64-v3.4.0.tar.gz \
| tar -xz -C /tmp && \
mv /tmp/git-lfs-3.4.0/git-lfs /usr/local/bin/git-lfs && \
chmod +x /usr/local/bin/git-lfs && \
git lfs install
# -----------------------------
# Working directory
# -----------------------------
WORKDIR /app
# Clean /app in case anything exists
RUN rm -rf /app/* || true
# -----------------------------
# Clone private repo, pull LFS, remove .git
# -----------------------------
ARG CACHEBUST=$(date +%s)
RUN --mount=type=secret,id=GH_TOKEN \
git clone --depth=1 https://$(cat /run/secrets/GH_TOKEN)@github.com/IMaduwike/telebot-api.git . && \
git lfs pull && \
rm -rf .git
# -----------------------------
# Move binary and make executable
# -----------------------------
RUN mv telegram-bot-api /usr/local/bin/telegram-bot-api && chmod +x /usr/local/bin/telegram-bot-api
# Make sure start.sh is executable
RUN chmod +x start.sh
# -----------------------------
# Install Node dependencies
# -----------------------------
RUN npm install
# -----------------------------
# Expose port for the proxy server
# -----------------------------
EXPOSE 7860
# -----------------------------
# Start the bot via shell
# -----------------------------
CMD ["sh", "./start.sh"]