Spaces:
Sleeping
Sleeping
File size: 2,122 Bytes
52f4d1c |
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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
FROM python:3.11-slim-bookworm AS base
## Basis ##
ENV ENV=prod \
PORT=9099
# Install GCC and build tools.
# These are kept in the final image to enable installing packages on the fly.
RUN apt-get update && \
apt-get install -y gcc build-essential curl git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y wget unzip openssh-client procps nodejs npm
ARG PIP_OPTIONS='-i https://mirrors.aliyun.com/pypi/simple/'
ARG ENABLE_OSS_MOUNT=""
RUN pip install -U pip pysocks ${PIP_OPTIONS}
# Install Chrome Driver
RUN mkdir /app
RUN cd /app/ && \
wget https://storage.googleapis.com/chrome-for-testing-public/136.0.7103.92/linux64/chromedriver-linux64.zip && \
unzip chromedriver-linux64.zip && \
rm chromedriver-linux64.zip
ENV CHROME_DRIVER_PATH=/app/chromedriver-linux64/chromedriver
RUN if [ "$ENABLE_OSS_MOUNT" = "true" ]; then \
apt-get update && \
apt-get install -y gdebi-core mime-support && \
cd /tmp && \
wget https://gosspublic.alicdn.com/ossfs/ossfs_1.91.6_ubuntu22.04_amd64.deb && \
gdebi ossfs_1.91.6_ubuntu22.04_amd64.deb -n && \
rm ossfs_1.91.6_ubuntu22.04_amd64.deb && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*; \
fi
FROM base as runner
WORKDIR /app
# Install Python dependencies
COPY ./requirements.txt .
RUN pip3 install uv ${PIP_OPTIONS}
RUN uv pip install --system -r requirements.txt --no-cache-dir ${PIP_OPTIONS}
# Copy the application code
RUN echo "start install aworld"
RUN mkdir -p /app/lib
RUN cd /app/lib && git clone https://github.com/inclusionAI/AWorld.git
RUN cd /app/lib/AWorld && git checkout framework_upgrade_aworldserver_gaia && pip install -r aworld/requirements.txt ${PIP_OPTIONS} && python setup.py install
RUN npx playwright install chrome --with-deps --no-shell
RUN cd /app
# Layer on for other components
FROM runner AS app
WORKDIR /app
COPY . .
# Expose the port
ENV HOST="0.0.0.0"
ENV PORT="9099"
# if we already installed the requirements on build, we can skip this step on run
ENTRYPOINT [ "bash", "start.sh" ]
|