clone3 commited on
Commit
4c6e399
·
verified ·
1 Parent(s): e7af1b5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -2
Dockerfile CHANGED
@@ -17,16 +17,20 @@ RUN git clone https://github.com/ChrisCindy/node-web-console.git .
17
  # Install dependencies
18
  RUN npm install
19
 
 
 
 
 
20
  # Copy entrypoint script
21
  COPY docker-entrypoint.sh /usr/local/bin/
22
 
23
  # Change permissions of the entrypoint script (before switching users)
24
  RUN chmod +x /usr/local/bin/docker-entrypoint.sh
25
 
26
- # Ensure the non-root user has full access to the entire /app directory
27
  RUN chown -R appuser:appuser /app
28
 
29
- # Switch to the non-root user
30
  USER appuser
31
 
32
  # Expose the port the app runs on
 
17
  # Install dependencies
18
  RUN npm install
19
 
20
+ # Modify the config/index.js file while still root (to avoid permission issues)
21
+ RUN sed -i "s/YOUR_USERNAME/${USER}/" config/index.js && \
22
+ sed -i "s/YOUR_PASSWORD/${PASSWORD}/" config/index.js
23
+
24
  # Copy entrypoint script
25
  COPY docker-entrypoint.sh /usr/local/bin/
26
 
27
  # Change permissions of the entrypoint script (before switching users)
28
  RUN chmod +x /usr/local/bin/docker-entrypoint.sh
29
 
30
+ # Ensure the non-root user has full access to the /app directory
31
  RUN chown -R appuser:appuser /app
32
 
33
+ # Switch to the non-root user after all modifications are made
34
  USER appuser
35
 
36
  # Expose the port the app runs on