Spaces:
Build error
Build error
users
Browse files- Dockerfile +10 -6
Dockerfile
CHANGED
@@ -1,21 +1,25 @@
|
|
1 |
FROM python:3.11
|
2 |
|
3 |
-
|
|
|
4 |
|
5 |
-
|
|
|
6 |
|
7 |
-
|
8 |
|
9 |
-
|
|
|
|
|
|
|
10 |
|
11 |
RUN pip install pdm
|
12 |
|
13 |
RUN pdm install
|
14 |
|
15 |
-
COPY server/ ./
|
16 |
|
17 |
ENV DEVICE cuda:0
|
18 |
ENV ATTN_IMPLEMENTATION flash_attention_2
|
19 |
-
ENV TRANSFORMERS_CACHE /code/.transformers_cache/
|
20 |
|
21 |
ENTRYPOINT [ "./entrypoint.sh" ]
|
|
|
1 |
FROM python:3.11
|
2 |
|
3 |
+
RUN useradd -m -u 1000 user
|
4 |
+
USER user
|
5 |
|
6 |
+
ENV HOME=/home/user \
|
7 |
+
PATH=/home/user/.local/bin:$PATH
|
8 |
|
9 |
+
WORKDIR $HOME/code
|
10 |
|
11 |
+
ENV PDM_CACHE_DIR $HOME/code/.pdm_cache/
|
12 |
+
ENV HF_HOME $HOME/code/.hf_home/
|
13 |
+
|
14 |
+
COPY --chown=user server/pdm.lock server/pyproject.toml ./
|
15 |
|
16 |
RUN pip install pdm
|
17 |
|
18 |
RUN pdm install
|
19 |
|
20 |
+
COPY --chown=user server/ ./
|
21 |
|
22 |
ENV DEVICE cuda:0
|
23 |
ENV ATTN_IMPLEMENTATION flash_attention_2
|
|
|
24 |
|
25 |
ENTRYPOINT [ "./entrypoint.sh" ]
|