Really-amin commited on
Commit
bfafe87
·
verified ·
1 Parent(s): 3f2fb6f

Upload 2 files

Browse files
Files changed (2) hide show
  1. Dockerfile +5 -5
  2. docker-compose.yml +2 -2
Dockerfile CHANGED
@@ -28,12 +28,12 @@ COPY . .
28
  # ساخت دایرکتوری برای لاگ‌ها
29
  RUN mkdir -p logs
30
 
31
- # Expose کردن پورت
32
- EXPOSE 8000
33
 
34
  # Health Check
35
  HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
36
- CMD python -c "import requests; requests.get('http://localhost:8000/health')" || exit 1
37
 
38
- # اجرای سرور
39
- CMD ["python", "-m", "uvicorn", "api_server_extended:app", "--host", "0.0.0.0", "--port", "8000"]
 
28
  # ساخت دایرکتوری برای لاگ‌ها
29
  RUN mkdir -p logs
30
 
31
+ # Expose کردن پورت (پیش‌فرض Hugging Face ۷۸۶۰ است)
32
+ EXPOSE 8000 7860
33
 
34
  # Health Check
35
  HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
36
+ CMD python -c "import os, requests; requests.get('http://localhost:{}/health'.format(os.getenv('PORT', '8000')))" || exit 1
37
 
38
+ # اجرای سرور (پشتیبانی از PORT متغیر محیطی برای Hugging Face)
39
+ CMD ["sh", "-c", "python -m uvicorn api_server_extended:app --host 0.0.0.0 --port ${PORT:-8000}"]
docker-compose.yml CHANGED
@@ -5,8 +5,8 @@ services:
5
  crypto-monitor:
6
  build: .
7
  container_name: crypto-monitor-app
8
- expose:
9
- - "8000"
10
  environment:
11
  - HOST=0.0.0.0
12
  - PORT=8000
 
5
  crypto-monitor:
6
  build: .
7
  container_name: crypto-monitor-app
8
+ ports:
9
+ - "8000:8000"
10
  environment:
11
  - HOST=0.0.0.0
12
  - PORT=8000