File size: 777 Bytes
d022305
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6f430f4
f809395
 
6f430f4
d022305
 
 
 
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
FROM python:3.11
ENV HF_PORT=7860

WORKDIR /code

# Expose port 7860 (default huggingface)
EXPOSE ${HF_PORT}

# Install First Dependencies
# "./requirements.txt" path-nya itu berdasarkan Dockerfile yang kita eksekusi (berati sudah di dalam src)
COPY ./requirements.txt /code/requirements.txt

RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt

# Copy all files required
# Instruction COPY, will create destination folder (this case "src") if didnt exist.
COPY . /code/src

# make Folder cache and open permission for it
RUN mkdir -p /.cache
RUN chmod 777 /.cache

# cause working dir it set from /code
# and we have code in /code/src
# for running command we user fastapi in "src.main:app"
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "7860"]