|
FROM ubuntu:22.04 |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
curl \ |
|
git \ |
|
wget \ |
|
make \ |
|
gcc \ |
|
build-essential \ |
|
libasound2 \ |
|
libgstreamer1.0-dev \ |
|
libunwind-dev \ |
|
libc++1 \ |
|
libssl-dev \ |
|
python3 \ |
|
python3-venv \ |
|
python3-pip \ |
|
python3-dev \ |
|
unzip \ |
|
jq \ |
|
vim \ |
|
ca-certificates \ |
|
&& apt-get clean && rm -rf /var/lib/apt/lists/* && rm -rf /tmp/* |
|
|
|
|
|
RUN wget https://golang.org/dl/go1.21.0.linux-amd64.tar.gz && \ |
|
tar -C /usr/local -xzf go1.21.0.linux-amd64.tar.gz && \ |
|
rm go1.21.0.linux-amd64.tar.gz |
|
|
|
|
|
ENV PATH=$PATH:/usr/local/go/bin |
|
ENV GOPATH=/go |
|
ENV PATH=$PATH:$GOPATH/bin |
|
RUN mkdir -p /go && chmod 777 /go |
|
|
|
|
|
ENV GOCACHE=/tmp/go-cache |
|
RUN mkdir -p /tmp/go-cache && chmod 777 /tmp/go-cache |
|
|
|
|
|
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ |
|
apt-get install -y nodejs && \ |
|
npm install -g pnpm |
|
|
|
|
|
WORKDIR /app |
|
RUN git clone --depth 1 https://github.com/TEN-framework/TEN-Agent.git /app |
|
|
|
|
|
RUN mkdir -p /tmp/ten_user && chmod 777 /tmp/ten_user |
|
RUN mkdir -p /app/fallback && chmod 777 /app/fallback |
|
|
|
|
|
RUN mkdir -p /app/server/bin && \ |
|
cd /app/server && \ |
|
GOCACHE=/tmp/go-cache go build -o bin/api main.go && \ |
|
chmod +x bin/api && \ |
|
cp bin/api /app/fallback/api && \ |
|
chmod 777 /app/fallback/api |
|
|
|
|
|
RUN ls -la /app/server/bin/api /app/fallback/api |
|
|
|
|
|
|
|
RUN echo "AGORA_APP_ID=${AGORA_APP_ID}\nAGORA_APP_CERTIFICATE=${AGORA_APP_CERTIFICATE}\nAZURE_STT_KEY=${AZURE_STT_KEY}\nAZURE_STT_REGION=${AZURE_STT_REGION}\nAZURE_TTS_KEY=${AZURE_TTS_KEY}\nAZURE_TTS_REGION=${AZURE_TTS_REGION}\nOPENAI_API_KEY=${OPENAI_API_KEY}" > /app/.env |
|
|
|
|
|
|
|
RUN cd /app/playground && pnpm install |
|
|
|
|
|
COPY start.sh /app/start.sh |
|
COPY fallback.py /app/fallback.py |
|
RUN chmod +x /app/start.sh /app/fallback.py |
|
|
|
|
|
EXPOSE 7860 8080 |
|
|
|
|
|
CMD ["/app/start.sh"] |
|
|