MJSHIN0122
commited on
Commit
β’
7e37010
1
Parent(s):
8a4c09f
initialize
Browse files- Dockerfile +23 -5
- app.py +1 -0
- entrypoint.sh +3 -0
Dockerfile
CHANGED
@@ -1,11 +1,29 @@
|
|
1 |
-
FROM python:3.
|
2 |
|
3 |
-
|
|
|
|
|
|
|
4 |
|
5 |
-
|
|
|
6 |
|
7 |
-
|
|
|
|
|
|
|
|
|
8 |
|
9 |
COPY . .
|
10 |
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.8-slim
|
2 |
|
3 |
+
# νμν ν¨ν€μ§ μ€μΉ (μ¬κΈ°μλ git ν¬ν¨)
|
4 |
+
RUN apt-get update \
|
5 |
+
&& apt-get install -y git \
|
6 |
+
&& rm -rf /var/lib/apt/lists/*
|
7 |
|
8 |
+
# non-root μ¬μ©μ μμ±
|
9 |
+
RUN useradd -m myuser
|
10 |
|
11 |
+
# μμ
λλ ν 리 μ€μ
|
12 |
+
WORKDIR /app
|
13 |
+
|
14 |
+
COPY requirements.txt .
|
15 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
16 |
|
17 |
COPY . .
|
18 |
|
19 |
+
# νμΌ μμ κΆ λ³κ²½
|
20 |
+
RUN chown -R myuser:myuser /app
|
21 |
+
|
22 |
+
|
23 |
+
COPY entrypoint.sh entrypoint.sh
|
24 |
+
RUN chmod +x entrypoint.sh
|
25 |
+
|
26 |
+
# μ¬μ©μ λ³κ²½
|
27 |
+
USER myuser
|
28 |
+
|
29 |
+
CMD ["./entrypoint.sh"]
|
app.py
CHANGED
@@ -9,4 +9,5 @@ Repo.clone_from(f"https://MJSHIN0122:{access_token}@hf.co:spaces/MJSHIN0122/llm_
|
|
9 |
print("Clone Done.")
|
10 |
|
11 |
sys.path.append(os.path.abspath("./repo_directory"))
|
|
|
12 |
import repo_directory.api_main as app
|
|
|
9 |
print("Clone Done.")
|
10 |
|
11 |
sys.path.append(os.path.abspath("./repo_directory"))
|
12 |
+
sys.path.append(os.path.abspath("./repo_directory/src"))
|
13 |
import repo_directory.api_main as app
|
entrypoint.sh
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/sh
|
2 |
+
python app.py
|
3 |
+
gunicorn -b 0.0.0.0:7860 repo_directory.api_app:app
|