Update Dockerfile
Browse files- Dockerfile +12 -22
Dockerfile
CHANGED
@@ -1,21 +1,9 @@
|
|
1 |
-
#
|
2 |
-
|
3 |
-
|
4 |
-
# Switch to the "user" user
|
5 |
-
USER user
|
6 |
|
7 |
-
# Set home to the user's home directory
|
8 |
-
ENV HOME=/home/user \
|
9 |
-
PATH=/home/user/.local/bin:$PATH
|
10 |
|
11 |
-
# Set the working directory to the user's home directory
|
12 |
-
WORKDIR $HOME/app
|
13 |
-
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
14 |
-
COPY --chown=user . $HOME/app
|
15 |
|
16 |
|
17 |
-
# Gunakan Node.js LTS
|
18 |
-
FROM node:lts
|
19 |
|
20 |
# Install pnpm
|
21 |
RUN npm install -g pnpm
|
@@ -31,18 +19,20 @@ ENV API_URL=https://chrunos-load.hf.space
|
|
31 |
ENV COOKIE_PATH=/cookies.json
|
32 |
ENV JWT_SECRET=eMdOGxjYn_nL0OlJdANOLLRim4UHItapf0fRmOC5q_yfLj0fMaPihbCn8sbJPBOm
|
33 |
|
34 |
-
#
|
35 |
-
|
36 |
-
PATH=/home/user/.local/bin:$PATH
|
37 |
-
|
38 |
-
# Buat pengguna non-root untuk keamanan
|
39 |
-
RUN useradd -o -u 1000 user && mkdir -p $HOME/app && chown -R user $HOME
|
40 |
|
41 |
-
#
|
42 |
USER user
|
43 |
|
44 |
-
#
|
|
|
|
|
|
|
|
|
45 |
WORKDIR $HOME/app
|
|
|
|
|
46 |
|
47 |
# Kloning repositori
|
48 |
RUN git clone -b queue https://github.com/imputnet/cobalt
|
|
|
1 |
+
# Gunakan Node.js LTS
|
2 |
+
FROM node:lts
|
|
|
|
|
|
|
3 |
|
|
|
|
|
|
|
4 |
|
|
|
|
|
|
|
|
|
5 |
|
6 |
|
|
|
|
|
7 |
|
8 |
# Install pnpm
|
9 |
RUN npm install -g pnpm
|
|
|
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 |
+
# Set home to the user's home directory
|
29 |
+
ENV HOME=/home/user \
|
30 |
+
PATH=/home/user/.local/bin:$PATH
|
31 |
+
|
32 |
+
# Set the working directory to the user's home directory
|
33 |
WORKDIR $HOME/app
|
34 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
35 |
+
COPY --chown=user . $HOME/app
|
36 |
|
37 |
# Kloning repositori
|
38 |
RUN git clone -b queue https://github.com/imputnet/cobalt
|