Chrunos commited on
Commit
a04f66b
·
verified ·
1 Parent(s): 92211a3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +56 -14
Dockerfile CHANGED
@@ -1,10 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # Gunakan Node.js LTS
2
  FROM node:lts
3
 
4
-
5
-
6
-
7
-
8
  # Install pnpm
9
  RUN npm install -g pnpm
10
 
@@ -15,26 +55,28 @@ RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
15
  COPY ./cookies.json /cookies.json
16
 
17
  # ENV
18
- ENV API_URL=https://chrunos-load.hf.space
19
  ENV COOKIE_PATH=/cookies.json
20
  ENV JWT_SECRET=eMdOGxjYn_nL0OlJdANOLLRim4UHItapf0fRmOC5q_yfLj0fMaPihbCn8sbJPBOm
21
 
22
- # Set up a new user named "user" with user ID 1000
23
- RUN useradd -m -u 1000 user
 
24
 
25
- # Switch to the "user" user
26
- USER user
27
 
 
 
28
 
29
- # Set the working directory to the user's home directory
30
  WORKDIR $HOME/app
31
- # Copy the current directory contents into the container at $HOME/app setting the owner to the user
32
- COPY --chown=user . $HOME/app
33
 
34
  # Kloning repositori
35
  RUN git clone -b queue https://github.com/imputnet/cobalt
36
 
37
-
 
38
 
39
  # Instal dependensi dengan pnpm
40
  RUN pnpm install
@@ -44,4 +86,4 @@ ENV API_PORT=7860
44
  EXPOSE 7860
45
 
46
  # Perintah untuk menjalankan aplikasi
47
- CMD ["pnpm", "start"]
 
1
+ Hugging Face's logo
2
+ Hugging Face
3
+ Search models, datasets, users...
4
+ Models
5
+ Datasets
6
+ Spaces
7
+ Posts
8
+ Docs
9
+ Enterprise
10
+ Pricing
11
+
12
+
13
+
14
+ Spaces:
15
+
16
+ Nando35
17
+ /
18
+ cobalt
19
+
20
+
21
+ like
22
+ 0
23
+ App
24
+ Files
25
+ Community
26
+ cobalt
27
+ /
28
+ Dockerfile
29
+
30
+ Nando35's picture
31
+ Nando35
32
+ Update Dockerfile
33
+ 6a990cd
34
+ verified
35
+ 3 days ago
36
+ raw
37
+
38
+ Copy download link
39
+ history
40
+ blame
41
+ contribute
42
+ delete
43
+
44
+ 1.03 kB
45
  # Gunakan Node.js LTS
46
  FROM node:lts
47
 
 
 
 
 
48
  # Install pnpm
49
  RUN npm install -g pnpm
50
 
 
55
  COPY ./cookies.json /cookies.json
56
 
57
  # ENV
58
+ ENV API_URL=https://nando35-cobalt.hf.space
59
  ENV COOKIE_PATH=/cookies.json
60
  ENV JWT_SECRET=eMdOGxjYn_nL0OlJdANOLLRim4UHItapf0fRmOC5q_yfLj0fMaPihbCn8sbJPBOm
61
 
62
+ # Atur variabel lingkungan
63
+ ENV HOME=/home/user \
64
+ PATH=/home/user/.local/bin:$PATH
65
 
66
+ # Buat pengguna non-root untuk keamanan
67
+ RUN useradd -m -u 1000 user && mkdir -p $HOME/app && chown -R user $HOME
68
 
69
+ # Alihkan ke pengguna non-root
70
+ USER user
71
 
72
+ # Atur direktori kerja
73
  WORKDIR $HOME/app
 
 
74
 
75
  # Kloning repositori
76
  RUN git clone -b queue https://github.com/imputnet/cobalt
77
 
78
+ # Masuk ke direktori proyek
79
+ WORKDIR $HOME/app/cobalt/api/src
80
 
81
  # Instal dependensi dengan pnpm
82
  RUN pnpm install
 
86
  EXPOSE 7860
87
 
88
  # Perintah untuk menjalankan aplikasi
89
+ CMD ["pnpm", "start"]