-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (38 loc) · 1.54 KB
/
Copy pathDockerfile
File metadata and controls
51 lines (38 loc) · 1.54 KB
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:24-alpine AS builder
RUN apk add --no-cache python3 make g++ bash
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY src/ ./src/
COPY tests/ ./tests/
COPY index.js ./
COPY config.yaml ./
RUN npm prune --omit=dev && \
npm cache clean --force
FROM node:24-alpine
RUN apk update && \
apk add --no-cache python3 ruby curl bash jq unzip wget ca-certificates git file zip xz lz4 diffutils tree rsync openssh-server cronie && \
ssh-keygen -A && \
adduser -S -G node -h /home/madz -s /bin/sh madz && \
mkdir -p /run/sshd /root/.cache /home/madz/.cache/madz/logs && \
printf '%s\n' '#!/bin/sh' '[ -f /etc/profile.d/madz-env.sh ] && . /etc/profile.d/madz-env.sh' 'if [ -x "/app" ]; then' ' echo "Starting madz..."' ' cd /app && exec node --expose-gc index.js --mode interactive' 'fi' > /etc/profile && \
passwd -d madz && \
sed -i 's/^#*PermitEmptyPasswords.*/PermitEmptyPasswords yes/' /etc/ssh/sshd_config && \
printf '%s\n' 'AcceptEnv *' >> /etc/ssh/sshd_config && \
curl -LsSf https://astral.sh/uv/install.sh | sh && \
mv /root/.local/bin/uv /usr/local/bin/uv
ENV HOME=/home/madz
WORKDIR /app
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package*.json ./
COPY LICENSE ./
COPY src/ ./src/
COPY config.yaml ./
COPY index.js ./
COPY prompts/ ./prompts/
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
RUN chown -R madz:node /app /home/madz && \
chmod -R g+rwX /app /home/madz
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["sleep", "infinity"]