GPTfree api commited on
Commit
c328979
·
verified ·
1 Parent(s): f87725d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -6
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- # Use an official Node.js runtime (lock to v16 compatible with npm@8.x)
2
  FROM node:16
3
 
4
  # Set the working directory in the container
@@ -7,14 +7,17 @@ WORKDIR /app
7
  # Clone the Rammerhead repository
8
  RUN git clone https://github.com/s-tn/rammerhead-heroku.git .
9
 
10
- # Ensure a compatible npm version (do not upgrade beyond [email protected])
 
 
 
11
  RUN npm install -g [email protected]
12
 
13
- # Install dependencies (use --legacy-peer-deps to handle potential dependency conflicts)
14
- RUN npm install --legacy-peer-deps
15
 
16
- # Build the project
17
- RUN npm run build
18
 
19
  # Expose the necessary port (adjust if the server uses a different port)
20
  EXPOSE 8080
 
1
+ # Use Node.js 16.x runtime
2
  FROM node:16
3
 
4
  # Set the working directory in the container
 
7
  # Clone the Rammerhead repository
8
  RUN git clone https://github.com/s-tn/rammerhead-heroku.git .
9
 
10
+ # Clean up any pre-existing package lock or node_modules (if corrupted)
11
+ RUN rm -rf package-lock.json node_modules
12
+
13
+ # Ensure npm is at a compatible version (keep it locked to npm 8.x for Node.js 16)
14
  RUN npm install -g [email protected]
15
 
16
+ # Install dependencies without running scripts (--ignore-scripts avoids failing pre/postinstall hooks)
17
+ RUN npm install --legacy-peer-deps --ignore-scripts
18
 
19
+ # Build the project explicitly (manual build command replaces npm hooks)
20
+ RUN npm run build || npm run bstart
21
 
22
  # Expose the necessary port (adjust if the server uses a different port)
23
  EXPOSE 8080