docker run -d \
--name sunoapi \
--restart always \
-p 8501:8501 \
-v ./sunoapi.db:/app/sunoapi.db \
-v ./images/upload:/app/images/upload \
-e OPENAI_BASE_URL=https://chatplusapi.cn \
-e OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxx \
-e S3_WEB_SITE_URL=https://sunoapi.s3.bitiful.net \
-e S3_ACCESSKEY_ID=xxxxxxxxxxxxxxxxxxxx \
-e S3_SECRETKEY_ID=xxxxxxxxxxxxxxxxxxxx \
sunoapi/sunoapi:latest
FROM python:3.10-slim-buster
WORKDIR /app
COPY requirements.txt ./
RUN --mount=type=cache,target=/root/.cache/pip \
pip install -r requirements.txt --no-cache-dir
COPY . .
EXPOSE 8501
CMD [ "nohup", "streamlit", "run", "main.py", "--server.maxUploadSize=2" ]
version: '3.2'
services:
sunoapi:
image: sunoapi/sunoapi:latest
container_name: sunoapi
ports:
- "8501:8501"
volumes:
- ./sunoapi.db:/app/sunoapi.db
- ./images/upload:/app/images/upload
environment:
- TZ=Asia/Shanghai
- OPENAI_BASE_URL=https://chatplusapi.cn
- OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxx
- S3_WEB_SITE_URL=https://sunoapi.s3.bitiful.net
- S3_ACCESSKEY_ID=xxxxxxxxxxxxxxxxxxxx
- S3_SECRETKEY_ID=xxxxxxxxxxxxxxxxxxxx
restart: always