fix: 优化docker构建速度
This commit is contained in:
@@ -8,11 +8,11 @@ EDGE_DISPATCH_HOST=0.0.0.0
|
||||
EDGE_DISPATCH_PORT=8020
|
||||
EDGE_MAX_DISPATCH_RECORDS=2000
|
||||
OSS_ENABLED=false
|
||||
OSS_ENDPOINT=https://oss-cn-hangzhou.aliyuncs.com
|
||||
OSS_BUCKET=your-bucket
|
||||
OSS_ACCESS_KEY_ID=your-ak
|
||||
OSS_ACCESS_KEY_SECRET=your-sk
|
||||
OSS_PUBLIC_BASE_URL=https://your-bucket.oss-cn-hangzhou.aliyuncs.com
|
||||
OSS_ENDPOINT=https://oss-cn-shanghai.aliyuncs.com
|
||||
OSS_BUCKET=aiclw
|
||||
OSS_ACCESS_KEY_ID=LTAI5tPB3Mg5A3p2imzrFjBp
|
||||
OSS_ACCESS_KEY_SECRET=vg917zL9EWSXvosVeiEcE6w4QT25bV
|
||||
OSS_PUBLIC_BASE_URL=https://aicdn-video-worker.oss-cn-shanghai.aliyuncs.com
|
||||
OSS_PREFIX=video-worker
|
||||
OUTPUT_DIR=./outputs
|
||||
RUNTIME_DIR=./runtime
|
||||
|
||||
@@ -3,6 +3,11 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: docker/edge-dispatch/Dockerfile
|
||||
args:
|
||||
PYTHON_IMAGE: registry.cn-hangzhou.aliyuncs.com/library/python:3.10-slim
|
||||
APT_MIRROR: mirrors.aliyun.com
|
||||
PIP_INDEX_URL: https://mirrors.aliyun.com/pypi/simple/
|
||||
PIP_TRUSTED_HOST: mirrors.aliyun.com
|
||||
container_name: video-worker-center-dispatch
|
||||
env_file:
|
||||
- .env.center
|
||||
|
||||
@@ -3,6 +3,11 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: docker/edge-dispatch/Dockerfile
|
||||
args:
|
||||
PYTHON_IMAGE: registry.cn-hangzhou.aliyuncs.com/library/python:3.10-slim
|
||||
APT_MIRROR: mirrors.aliyun.com
|
||||
PIP_INDEX_URL: https://mirrors.aliyun.com/pypi/simple/
|
||||
PIP_TRUSTED_HOST: mirrors.aliyun.com
|
||||
container_name: edge-dispatch-service
|
||||
env_file:
|
||||
- .env
|
||||
|
||||
@@ -1,12 +1,24 @@
|
||||
FROM python:3.10-slim
|
||||
ARG PYTHON_IMAGE=registry.cn-hangzhou.aliyuncs.com/library/python:3.10-slim
|
||||
FROM ${PYTHON_IMAGE}
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1
|
||||
PYTHONUNBUFFERED=1 \
|
||||
PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
||||
PIP_NO_CACHE_DIR=1
|
||||
|
||||
ARG APT_MIRROR=mirrors.aliyun.com
|
||||
ARG PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/
|
||||
ARG PIP_TRUSTED_HOST=mirrors.aliyun.com
|
||||
|
||||
RUN sed -i "s@deb.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list.d/debian.sources \
|
||||
&& sed -i "s@security.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list.d/debian.sources
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt /app/requirements.txt
|
||||
RUN pip install --no-cache-dir -r /app/requirements.txt
|
||||
RUN pip config set global.index-url "${PIP_INDEX_URL}" \
|
||||
&& pip config set global.trusted-host "${PIP_TRUSTED_HOST}" \
|
||||
&& pip install -r /app/requirements.txt
|
||||
|
||||
COPY app /app/app
|
||||
|
||||
|
||||
Reference in New Issue
Block a user