Spaces:
Paused

File size: 1,270 Bytes
1e79bdd
3a29b38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fe438ea
 
3a29b38
fe438ea
1e79bdd
fe438ea
 
 
 
9a4934f
 
 
 
1e79bdd
3a29b38
9a4934f
3a29b38
 
 
 
 
 
 
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM node:22-bookworm-slim

ENV DEBIAN_FRONTEND=noninteractive \
    PORT=7860 \
    HOME=/home/claude \
    WORKSPACE_DIR=/workspace

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
      bash \
      ca-certificates \
      curl \
      git \
      jq \
      less \
      procps \
      python3 \
      ripgrep \
      tini \
      unzip \
      vim \
    && rm -rf /var/lib/apt/lists/*

RUN useradd --create-home --shell /bin/bash claude \
    && mkdir -p /workspace \
    && chown -R claude:claude /workspace /home/claude

# Install code-server standalone (avoids npm root permission errors)
RUN curl -fsSL https://code-server.dev/install.sh | sh

# Setup local npm for claude user and install claude-code
USER claude
ENV NPM_CONFIG_PREFIX=/home/claude/.npm-global
ENV PATH=$PATH:/home/claude/.npm-global/bin
RUN npm install -g @anthropic-ai/claude-code

COPY --chown=claude:claude package.json /home/claude/app/package.json
WORKDIR /home/claude/app
RUN npm install --omit=dev

WORKDIR /workspace

COPY --chown=claude:claude slack-bot.js /home/claude/app/slack-bot.js
COPY --chown=claude:claude start.sh /home/claude/start.sh
RUN chmod +x /home/claude/start.sh

EXPOSE 7860

ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["/home/claude/start.sh"]