Natthathida commited on
Commit
3f3f57b
·
verified ·
1 Parent(s): 91c7cb5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +40 -35
Dockerfile CHANGED
@@ -10,62 +10,67 @@ RUN npm run build
10
  RUN ls -al
11
 
12
  FROM python:3.10-slim AS backend
 
 
 
 
13
  WORKDIR /app
14
 
15
- COPY ./requirements.txt .
16
 
17
- # RUN rm -rf /var/cache/apk/* && \
18
- # rm -rf /root/.cache
19
 
20
  RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
21
 
 
 
22
  EXPOSE 5000
23
 
24
  WORKDIR /app
25
  COPY --from=builder /app/build ./static
26
  COPY . .
27
 
28
- RUN mkdir -p /app/cache/hub/models--suno--bark/snapshots/70a8a7d34168586dc5d028fa9666aceade177992
29
- RUN mkdir -p /app/cache/hub/models--suno--bark/blobs
30
- RUN mkdir -p /app/cache/hub/models--suno--bark/refs/main
31
- RUN mkdir -p /app/cache/hub/hub/models--suno--bark/blobs
32
- RUN mkdir -p /app/cache/hub/hub/models--suno--bark/snapshots/70a8a7d34168586dc5d028fa9666aceade177992
33
- RUN mkdir -p /app/cache/hub/hub/models--suno--bark/refs/main
34
- RUN mkdir -p /app/cache/hub/hub/hub/models--suno--bark/blobs
35
- RUN mkdir -p /app/cache/hub/hub/hub/models--suno--bark/snapshots/70a8a7d34168586dc5d028fa9666aceade177992
36
- RUN mkdir -p /app/cache/hub/hub/hub/models--suno--bark/refs/main
37
-
38
- # ตั้งค่าสิทธิ์ในไดเรกทอรี snapshots
39
- RUN find /app/cache/hub/models--suno--bark/snapshots -type f -exec chmod u+rw {} \; \
40
- && find /app/cache/hub/models--suno--bark/snapshots -type d -exec chmod u+rwx {} \;
41
-
42
- # ตั้งค่าสิทธิ์ในไดเรกทอรี blobs
43
- RUN find /app/cache/hub/models--suno--bark/blobs -type f -exec chmod u+rw {} \; \
44
- && find /app/cache/hub/models--suno--bark/blobs -type d -exec chmod u+rwx {} \;
45
 
46
- # ตั้งค่าสิทธิ์ในไดเรกทอรี refs/main
47
- RUN find /app/cache/hub/models--suno--bark/refs/main -type f -exec chmod u+rw {} \; \
48
- && find /app/cache/hub/models--suno--bark/refs/main -type d -exec chmod u+rwx {} \;
49
 
50
- # ตั้งค่าสิทธิ์ในไดเรกทอรี refs/main
51
- RUN find /app/cache/hub/hub/models--suno--bark/refs/main -type f -exec chmod u+rw {} \; \
52
- && find /app/cache/hub/hub/models--suno--bark/refs/main -type d -exec chmod u+rwx {} \;
53
 
54
- # ตั้งค่าสิทธิ์ในไดเรกทอรี refs/main
55
- RUN find /app/cache/hub/hub/hub/models--suno--bark/refs/main -type f -exec chmod u+rw {} \; \
56
- && find /app/cache/hub/hub/hub/models--suno--bark/refs/main -type d -exec chmod u+rwx {} \;
57
 
58
  RUN chmod -R u+rwX /app/cache/hub
59
- RUN chmod -R u+rwX /app/cache/hub/hub
60
- RUN chmod -R u+rwX /app/cache/hub/hub/hub
61
 
62
  RUN ls -al /app/cache/hub/
63
- RUN ls -al /app/cache/hub/hub/hub/
64
- RUN ls -al /app/cache/hub/hub/models--suno--bark/refs/
65
 
66
  ENV HF_HOME=/app/cache/hub/
67
- ENV HF_HOME=/app/cache/hub/hub
68
- ENV HF_HOME=/app/cache/hub/hub/hub
69
 
70
  CMD ["python", "app.py"]
71
 
 
10
  RUN ls -al
11
 
12
  FROM python:3.10-slim AS backend
13
+
14
+ RUN useradd -m -u 1000 user
15
+ USER user
16
+
17
  WORKDIR /app
18
 
19
+ RUN chown -R user:user /code
20
 
21
+ COPY ./requirements.txt /code/requirements.txt
 
22
 
23
  RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
24
 
25
+ COPY --chown=user:user . /code
26
+
27
  EXPOSE 5000
28
 
29
  WORKDIR /app
30
  COPY --from=builder /app/build ./static
31
  COPY . .
32
 
33
+ # RUN mkdir -p /app/cache/hub/models--suno--bark/snapshots/70a8a7d34168586dc5d028fa9666aceade177992
34
+ # RUN mkdir -p /app/cache/hub/models--suno--bark/blobs
35
+ # RUN mkdir -p /app/cache/hub/models--suno--bark/refs/main
36
+ # RUN mkdir -p /app/cache/hub/hub/models--suno--bark/blobs
37
+ # RUN mkdir -p /app/cache/hub/hub/models--suno--bark/snapshots/70a8a7d34168586dc5d028fa9666aceade177992
38
+ # RUN mkdir -p /app/cache/hub/hub/models--suno--bark/refs/main
39
+ # RUN mkdir -p /app/cache/hub/hub/hub/models--suno--bark/blobs
40
+ # RUN mkdir -p /app/cache/hub/hub/hub/models--suno--bark/snapshots/70a8a7d34168586dc5d028fa9666aceade177992
41
+ # RUN mkdir -p /app/cache/hub/hub/hub/models--suno--bark/refs/main
42
+
43
+ # # ตั้งค่าสิทธิ์ในไดเรกทอรี snapshots
44
+ # RUN find /app/cache/hub/models--suno--bark/snapshots -type f -exec chmod u+rw {} \; \
45
+ # && find /app/cache/hub/models--suno--bark/snapshots -type d -exec chmod u+rwx {} \;
46
+
47
+ # # ตั้งค่าสิทธิ์ในไดเรกทอรี blobs
48
+ # RUN find /app/cache/hub/models--suno--bark/blobs -type f -exec chmod u+rw {} \; \
49
+ # && find /app/cache/hub/models--suno--bark/blobs -type d -exec chmod u+rwx {} \;
50
 
51
+ # # ตั้งค่าสิทธิ์ในไดเรกทอรี refs/main
52
+ # RUN find /app/cache/hub/models--suno--bark/refs/main -type f -exec chmod u+rw {} \; \
53
+ # && find /app/cache/hub/models--suno--bark/refs/main -type d -exec chmod u+rwx {} \;
54
 
55
+ # # ตั้งค่าสิทธิ์ในไดเรกทอรี refs/main
56
+ # RUN find /app/cache/hub/hub/models--suno--bark/refs/main -type f -exec chmod u+rw {} \; \
57
+ # && find /app/cache/hub/hub/models--suno--bark/refs/main -type d -exec chmod u+rwx {} \;
58
 
59
+ # # ตั้งค่าสิทธิ์ในไดเรกทอรี refs/main
60
+ # RUN find /app/cache/hub/hub/hub/models--suno--bark/refs/main -type f -exec chmod u+rw {} \; \
61
+ # && find /app/cache/hub/hub/hub/models--suno--bark/refs/main -type d -exec chmod u+rwx {} \;
62
 
63
  RUN chmod -R u+rwX /app/cache/hub
64
+ # RUN chmod -R u+rwX /app/cache/hub/hub
65
+ # RUN chmod -R u+rwX /app/cache/hub/hub/hub
66
 
67
  RUN ls -al /app/cache/hub/
68
+ # RUN ls -al /app/cache/hub/hub/hub/
69
+ # RUN ls -al /app/cache/hub/hub/models--suno--bark/refs/
70
 
71
  ENV HF_HOME=/app/cache/hub/
72
+ # ENV HF_HOME=/app/cache/hub/hub
73
+ # ENV HF_HOME=/app/cache/hub/hub/hub
74
 
75
  CMD ["python", "app.py"]
76