Fix: Clone moltbot repo and install Bun in Dockerfile
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 12m31s
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 12m31s
This commit is contained in:
38
Dockerfile
38
Dockerfile
@@ -2,32 +2,46 @@ FROM node:22-bookworm
|
|||||||
|
|
||||||
# Install system dependencies
|
# Install system dependencies
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
socat \
|
curl \
|
||||||
git \
|
git \
|
||||||
python3 \
|
python3 \
|
||||||
make \
|
make \
|
||||||
g++ \
|
g++ \
|
||||||
|
socat \
|
||||||
|
unzip \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Install pnpm
|
# Install Bun (required for build scripts)
|
||||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
RUN curl -fsSL https://bun.sh/install | bash
|
||||||
|
ENV BUN_INSTALL="/root/.bun"
|
||||||
|
ENV PATH="${BUN_INSTALL}/bin:${PATH}"
|
||||||
|
|
||||||
|
# Enable pnpm
|
||||||
|
RUN corepack enable
|
||||||
|
|
||||||
# Set up user
|
|
||||||
USER node
|
|
||||||
WORKDIR /home/node/app
|
WORKDIR /home/node/app
|
||||||
|
|
||||||
# Copy application code
|
# Clone the official repository
|
||||||
COPY --chown=node:node . .
|
# We clone into the current directory
|
||||||
|
RUN git clone https://github.com/moltbot/moltbot.git .
|
||||||
|
|
||||||
# Build process
|
# Install dependencies
|
||||||
RUN pnpm install --frozen-lockfile
|
RUN pnpm install --frozen-lockfile
|
||||||
RUN pnpm build
|
|
||||||
|
# Build application
|
||||||
|
RUN CLAWDBOT_A2UI_SKIP_MISSING=1 pnpm build
|
||||||
|
|
||||||
|
# Build UI
|
||||||
|
# Force pnpm for UI build as per official Dockerfile
|
||||||
|
ENV CLAWDBOT_PREFER_PNPM=1
|
||||||
|
RUN pnpm ui:install
|
||||||
RUN pnpm ui:build
|
RUN pnpm ui:build
|
||||||
|
|
||||||
# Fix permissions
|
# Fix permissions for the node user
|
||||||
USER root
|
|
||||||
RUN chown -R node:node /home/node/app
|
RUN chown -R node:node /home/node/app
|
||||||
|
|
||||||
|
# Security: Run as non-root
|
||||||
USER node
|
USER node
|
||||||
|
|
||||||
# Default command (can be overridden by docker-compose)
|
# Start the application
|
||||||
CMD ["node", "dist/index.js"]
|
CMD ["node", "dist/index.js"]
|
||||||
|
|||||||
Reference in New Issue
Block a user