parent
ce7b5fc133
commit
9c61205d5e
@ -0,0 +1,17 @@
|
|||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
*.pyo
|
||||||
|
*.db
|
||||||
|
.git/
|
||||||
|
.gitignore
|
||||||
|
*.md
|
||||||
|
.trae/
|
||||||
|
.vscode/
|
||||||
|
*.egg-info/
|
||||||
|
dist/
|
||||||
|
build/
|
||||||
|
.eggs/
|
||||||
|
*.egg
|
||||||
|
docker-compose.yml
|
||||||
|
Dockerfile
|
||||||
|
.dockerignore
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
FROM python:3.11-slim
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
ENV PYTHONDONTWRITEBYTECODE=1
|
||||||
|
ENV PYTHONUNBUFFERED=1
|
||||||
|
ENV BUFFER_DB_PATH=/app/data/buffer.db
|
||||||
|
ENV BUFFER_HOST=0.0.0.0
|
||||||
|
ENV BUFFER_PORT=8600
|
||||||
|
|
||||||
|
RUN rm -f /etc/apt/sources.list.d/debian.sources && \
|
||||||
|
echo "deb http://mirrors.aliyun.com/debian trixie main" > /etc/apt/sources.list && \
|
||||||
|
echo "deb http://mirrors.aliyun.com/debian trixie-updates main" >> /etc/apt/sources.list && \
|
||||||
|
echo "deb http://mirrors.aliyun.com/debian-security trixie-security main" >> /etc/apt/sources.list && \
|
||||||
|
apt-get update && \
|
||||||
|
apt-get install -y --no-install-recommends gcc && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
COPY requirements.txt .
|
||||||
|
RUN pip install --no-cache-dir -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN mkdir -p /app/data
|
||||||
|
|
||||||
|
EXPOSE 8600
|
||||||
|
|
||||||
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8600"]
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
buffer-platform:
|
||||||
|
build: .
|
||||||
|
container_name: buffer-platform
|
||||||
|
ports:
|
||||||
|
- "9600:8600"
|
||||||
|
volumes:
|
||||||
|
- E:\docker_workspace\futures_datas:/app/data
|
||||||
|
environment:
|
||||||
|
- BUFFER_DB_PATH=/app/data/buffer.db
|
||||||
|
- BUFFER_HOST=0.0.0.0
|
||||||
|
- BUFFER_PORT=8600
|
||||||
|
- CACHE_TTL=300
|
||||||
|
- BUFFER_LOG_LEVEL=INFO
|
||||||
|
restart: unless-stopped
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "curl", "-f", "http://localhost:8600/api/v1/health"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 3
|
||||||
|
start_period: 40s
|
||||||
Loading…
Reference in new issue