rrevo commited on
Commit
c92940c
·
1 Parent(s): b93c7c6

dockerilfe

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -9
Dockerfile CHANGED
@@ -1,4 +1,14 @@
1
- FROM python:3.11
 
 
 
 
 
 
 
 
 
 
2
 
3
  RUN useradd -m -u 1000 user
4
  USER user
@@ -8,17 +18,13 @@ ENV HOME=/home/user \
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
 
 
1
+ FROM python:3.11 as builder
2
+
3
+ WORKDIR /code
4
+
5
+ COPY server/pdm.lock server/pyproject.toml ./
6
+
7
+ RUN pip install pdm
8
+
9
+ RUN pdm install
10
+
11
+ FROM nvidia/cuda:12.3.1-devel-ubuntu20.04
12
 
13
  RUN useradd -m -u 1000 user
14
  USER user
 
18
 
19
  WORKDIR $HOME/code
20
 
21
+ COPY --from=builder --chown=user /code/.venv ./.venv
 
 
 
 
 
 
 
22
 
23
  COPY --chown=user server/ ./
24
 
25
+ ENV PDM_CACHE_DIR $HOME/code/.pdm_cache/
26
+ ENV HF_HOME $HOME/code/.hf_home/
27
+
28
  ENV DEVICE cuda:0
29
  ENV ATTN_IMPLEMENTATION flash_attention_2
30