signal-tracker / Dockerfile
vumichien's picture
Upload Flask app
7845e57
raw
history blame
798 Bytes
# Sử dụng một image chính thức của Python 3
FROM python:3.9-slim
# Thiết lập biến môi trường để Python không tạo các file pyc
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Tạo và đặt thư mục làm việc cho ứng dụng FastAPI
WORKDIR /app
# Sao chép file requirements.txt vào container
COPY requirements.txt /app/
# Cài đặt các dependencies từ requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Sao chép toàn bộ mã nguồn ứng dụng vào container
COPY . /app/
# Sao chép cơ sở dữ liệu SQLite vào container
COPY ./database.db /tmp/database.db
# Expose port 5000 for FastAPI
EXPOSE 5000
# Chạy ứng dụng FastAPI bằng Uvicorn
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "5000"]