xdxb commited on
Commit
a0bf9d4
·
verified ·
1 Parent(s): 1b7fa6e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +43 -3
Dockerfile CHANGED
@@ -1,3 +1,43 @@
1
- FROM dbcccc/ttsfm:latest
2
- # 原始镜像的 docker-entrypoint.sh 应该会处理应用的启动
3
- # 确保原始镜像的 EXPOSE 指令和启动命令是正确的
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use Python 3.13 slim image as base
2
+ FROM python:3.13-slim
3
+
4
+ # Install Redis
5
+ RUN apt-get update && \
6
+ apt-get install -y redis-server && \
7
+ apt-get clean && \
8
+ rm -rf /var/lib/apt/lists/*
9
+
10
+ # Set working directory
11
+ WORKDIR /app
12
+
13
+ # Copy requirements first to leverage Docker cache
14
+ COPY requirements.txt .
15
+
16
+ # Install dependencies
17
+ RUN pip install --no-cache-dir -r requirements.txt waitress
18
+
19
+ # Copy application files
20
+ COPY . .
21
+
22
+ # Create directory for Redis data
23
+ RUN mkdir -p /data/redis
24
+
25
+ # Set default environment variables
26
+ ENV HOST=0.0.0.0 \
27
+ PORT=7000 \
28
+ VERIFY_SSL=true \
29
+ MAX_QUEUE_SIZE=100 \
30
+ FLASK_ENV=production \
31
+ FLASK_APP=app.py \
32
+ CELERY_BROKER_URL=redis://localhost:6379/0 \
33
+ CELERY_RESULT_BACKEND=redis://localhost:6379/0
34
+
35
+ # Expose ports for Flask and Redis
36
+ EXPOSE 7000 6379
37
+
38
+ # Copy the startup script
39
+ COPY docker-entrypoint.sh /usr/local/bin/
40
+ RUN chmod +x /usr/local/bin/docker-entrypoint.sh
41
+
42
+ # Set the entrypoint
43
+ ENTRYPOINT ["docker-entrypoint.sh"]