/ Dockerfile
Dockerfile
 1  # Use a base image with Python3.9 and Nodejs20 slim version
 2  FROM nikolaik/python-nodejs:python3.9-nodejs20-slim
 3  
 4  # Install Debian software needed by MetaGPT and clean up in one RUN command to reduce image size
 5  RUN apt update &&\
 6      apt install -y libgomp1 git chromium fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 --no-install-recommends file &&\
 7      apt clean && rm -rf /var/lib/apt/lists/*
 8  
 9  # Install Mermaid CLI globally
10  ENV CHROME_BIN="/usr/bin/chromium" \
11      puppeteer_config="/app/metagpt/config/puppeteer-config.json"\
12      PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"
13  RUN npm install -g @mermaid-js/mermaid-cli &&\
14      npm cache clean --force
15  
16  # Install Python dependencies and install MetaGPT
17  COPY . /app/metagpt
18  WORKDIR /app/metagpt
19  RUN mkdir workspace &&\
20      pip install --no-cache-dir -r requirements.txt &&\
21      pip install -e .
22  
23  # Running with an infinite loop using the tail command
24  CMD ["sh", "-c", "tail -f /dev/null"]
25