File size: 1,811 Bytes
2d610a5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Use Python 3.10.5 as the base image
FROM python:3.10.5-slim

# Set the working directory in the container
WORKDIR /app

# Upgrade pip, install git, MeCab and its dependencies
RUN apt-get update \
    && apt-get install -y git mecab libmecab-dev mecab-ipadic mecab-ipadic-utf8 \
    && pip install --upgrade pip

# Install PyTorch
# Note: Replace the next line with the correct command to install the PyTorch version compatible with your deepspeed version
RUN pip install torch
RUN pip install librosa -U

# Install other dependencies from requirements.txt
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt

# List installed packages for debugging
RUN pip list

# Copy the rest of your application's code
COPY . /app/

# RUN cd /tmp && mkdir cache1

ENV NUMBA_CACHE_DIR=/tmp


# Expose the port your app runs on
EXPOSE 7860

# Download UniDic for MeCab
RUN pip install unidic \
    && python -m unidic download

# Set the environment variable for Coqui TTS
ENV COQUI_TOS_AGREED=1
RUN pip install numba==0.48

# Apply migrations
RUN python manage.py migrate

# Use Django's built-in server to serve the app
CMD ["python", "manage.py", "runserver", "0.0.0.0:7860"]



# # Fast api
# # Use the official Python image as a parent image
# FROM python:3.10.5-slim

# # Set the working directory in the container
# WORKDIR /app

# # Copy the requirements file into the container at /app
# COPY requirements.txt .

# # Install any needed packages specified in requirements.txt
# RUN pip install -r requirements.txt

# # Copy the current directory contents into the container at /app
# COPY . .

# # Expose port 7860 to the outside world
# EXPOSE 7860

# # Define the command to run your FastAPI application using uvicorn
# CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]