File size: 1,067 Bytes
c940e82
 
83959c7
 
c940e82
7a042ce
c940e82
 
83959c7
 
 
c940e82
83959c7
c940e82
 
 
7a042ce
 
 
 
c940e82
 
7a042ce
ea0fdc0
c940e82
 
 
 
 
ea0fdc0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM node:20-slim

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends \
    git curl bash ca-certificates nano procps locales python3 build-essential tini \
    && rm -rf /var/lib/apt/lists/*

RUN curl -Lo /usr/local/bin/ttyd https://github.com/tsl0922/ttyd/releases/download/1.7.3/ttyd.x86_64 && \
    chmod +x /usr/local/bin/ttyd

RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
ENV LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8

RUN npm install -g @anthropic-ai/claude-code && npm cache clean --force

# الحل هنا: نستخدم المستخدم node الموجود مسبقاً بدلاً من إنشاء واحد جديد
USER node
ENV HOME=/home/node
ENV PATH=$HOME/.local/bin:$PATH TERM=xterm-256color

WORKDIR $HOME/app
# تأكد من أن المجلدات مملوكة للمستخدم node
RUN mkdir -p $HOME/app $HOME/.config

EXPOSE 7860

ENTRYPOINT ["/usr/bin/tini", "--"]

CMD ["ttyd", "-p", "7860", "-i", "0.0.0.0", "-W", "-t", "fontSize=15", "bash", "-lc", "claude"]