Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
alexfremont
commited on
Commit
·
f430808
1
Parent(s):
162cbb0
testing new config docker
Browse files- Dockerfile +11 -4
- README.md +1 -0
Dockerfile
CHANGED
@@ -5,16 +5,23 @@ FROM python:3.9-slim
|
|
5 |
WORKDIR /app
|
6 |
|
7 |
# Copier les fichiers de dépendances
|
8 |
-
|
|
|
|
|
9 |
|
10 |
# Installer les dépendances
|
11 |
RUN pip install --no-cache-dir -r requirements.txt
|
12 |
|
13 |
# Copier le reste de l'application
|
14 |
-
COPY .
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
# Exposer le port sur lequel l'application va tourner
|
17 |
-
EXPOSE
|
18 |
|
19 |
# Commande pour lancer l'application
|
20 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "
|
|
|
5 |
WORKDIR /app
|
6 |
|
7 |
# Copier les fichiers de dépendances
|
8 |
+
RUN useradd -m -u 1000 user
|
9 |
+
COPY --chown=user ./requirements.txt requirements.txt
|
10 |
+
|
11 |
|
12 |
# Installer les dépendances
|
13 |
RUN pip install --no-cache-dir -r requirements.txt
|
14 |
|
15 |
# Copier le reste de l'application
|
16 |
+
COPY --chown=user . /app
|
17 |
+
|
18 |
+
USER user
|
19 |
+
|
20 |
+
ENV HOME=/home/user \
|
21 |
+
PATH="/home/user/.local/bin:$PATH"
|
22 |
|
23 |
# Exposer le port sur lequel l'application va tourner
|
24 |
+
EXPOSE 7860
|
25 |
|
26 |
# Commande pour lancer l'application
|
27 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
README.md
CHANGED
@@ -7,6 +7,7 @@ sdk: docker
|
|
7 |
pinned: false
|
8 |
license: unknown
|
9 |
short_description: API for all API models that corresponds to Lamp category
|
|
|
10 |
---
|
11 |
|
12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
7 |
pinned: false
|
8 |
license: unknown
|
9 |
short_description: API for all API models that corresponds to Lamp category
|
10 |
+
app_port: 7860
|
11 |
---
|
12 |
|
13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|