jurmy24 commited on
Commit
5a9fad9
·
1 Parent(s): 41b4066

fix: modify dockerfile to use what other space had

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -11
Dockerfile CHANGED
@@ -1,17 +1,19 @@
1
  FROM node:18-alpine
2
 
3
- # Set up a new user named "user" with user ID 1000
4
- RUN adduser -D user || adduser -D -u 1001 user
5
 
6
- # Switch to the "user" user
7
- USER user
8
-
9
- # Set home to the user's home directory
10
  ENV HOME=/home/user \
11
  PATH=/home/user/.local/bin:$PATH
12
 
13
- # Set the working directory
14
  WORKDIR $HOME/app
 
 
 
 
 
15
 
16
  # Copy package files
17
  COPY --chown=user viewer/package*.json ./
@@ -22,10 +24,6 @@ RUN npm install
22
  # Copy the entire viewer directory
23
  COPY --chown=user viewer/ .
24
 
25
- # Ensure proper file permissions and ownership
26
- RUN chmod -R 755 . && \
27
- chown -R user:user .
28
-
29
  # Build the application
30
  RUN npm run build
31
 
 
1
  FROM node:18-alpine
2
 
3
+ # Create user with UID 1001 (since 1000 is taken by node user)
4
+ RUN adduser -D -u 1001 user
5
 
6
+ # Set up environment variables
 
 
 
7
  ENV HOME=/home/user \
8
  PATH=/home/user/.local/bin:$PATH
9
 
10
+ # Create and set up app directory with proper permissions
11
  WORKDIR $HOME/app
12
+ RUN mkdir -p $HOME/app && \
13
+ chown -R user:user $HOME/app
14
+
15
+ # Switch to the user
16
+ USER user
17
 
18
  # Copy package files
19
  COPY --chown=user viewer/package*.json ./
 
24
  # Copy the entire viewer directory
25
  COPY --chown=user viewer/ .
26
 
 
 
 
 
27
  # Build the application
28
  RUN npm run build
29