添加 Dockerfile 用于构建视频解码服务镜像 添加 docker-compose.yaml 用于定义服务配置和部署
@@ -0,0 +1,12 @@
+FROM registry.cn-hangzhou.aliyuncs.com/stuuudy/python3.9-node:latest
+
+RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
+RUN mkdir -p /video_decode
+WORKDIR /video_decode
+COPY . /video_decode
+RUN pip install -r requirements.txt
+CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
@@ -0,0 +1,15 @@
+version: "3.8"
+services:
+ server:
+ build:
+ context: .
+ dockerfile: Dockerfile
+ image: video_decode
+ container_name: video_decode
+ restart: always
+ ports:
+ - "8000:8000"
+ environment:
+ - ENV=prod
+ entrypoint: ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]