Upload 2 files
Browse files- Dockerfile +5 -5
- 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:
|
| 37 |
|
| 38 |
-
# اجرای سرور
|
| 39 |
-
CMD ["
|
|
|
|
| 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 |
-
|
| 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
|