clone3 commited on
Commit
083649c
·
verified ·
1 Parent(s): 3e238cf

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -8
Dockerfile CHANGED
@@ -14,24 +14,24 @@ RUN useradd --create-home --shell /bin/bash appuser
14
  # Clone the repository
15
  RUN git clone https://github.com/ChrisCindy/node-web-console.git .
16
 
17
- # Change ownership of the directory to the non-root user
18
- RUN chown -R appuser:appuser /app
19
-
20
- # Switch to the non-root user
21
- USER appuser
22
-
23
  # Install dependencies
24
  RUN npm install
25
 
26
  # Copy entrypoint script
27
  COPY docker-entrypoint.sh /usr/local/bin/
28
 
29
- # Make the script executable
30
  RUN chmod +x /usr/local/bin/docker-entrypoint.sh
31
 
 
 
 
 
 
 
32
  # Expose the port the app runs on
33
  EXPOSE 3000
34
 
35
  # Run the entrypoint script and start the web server in production mode
36
  ENTRYPOINT ["docker-entrypoint.sh"]
37
- CMD ["npm", "run", "prod"]
 
14
  # Clone the repository
15
  RUN git clone https://github.com/ChrisCindy/node-web-console.git .
16
 
 
 
 
 
 
 
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 (do this before switching users)
24
  RUN chmod +x /usr/local/bin/docker-entrypoint.sh
25
 
26
+ # Change ownership of the directory to the non-root user
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
33
  EXPOSE 3000
34
 
35
  # Run the entrypoint script and start the web server in production mode
36
  ENTRYPOINT ["docker-entrypoint.sh"]
37
+ CMD ["npm", "run", "prod"]