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

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -9
Dockerfile CHANGED
@@ -1,26 +1,32 @@
1
- # Use Node.js 16.x runtime
2
  FROM node:16
3
 
4
- # Set the working directory in the container
5
  WORKDIR /app
6
 
 
 
 
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
24
 
25
- # Start the Rammerhead server
26
  CMD [ "node", "src/server.js" ]
 
1
+ # Use Node.js 16 runtime
2
  FROM node:16
3
 
4
+ # Set the working directory
5
  WORKDIR /app
6
 
7
+ # Install dependencies required for native bindings
8
+ RUN apt-get update && apt-get install -y python3 build-essential
9
+
10
  # Clone the Rammerhead repository
11
  RUN git clone https://github.com/s-tn/rammerhead-heroku.git .
12
 
13
+ # Clean up any previous build files
14
  RUN rm -rf package-lock.json node_modules
15
 
16
+ # Ensure npm is compatible with Node.js 16
17
  RUN npm install -g [email protected]
18
 
19
+ # Install project dependencies
20
  RUN npm install --legacy-peer-deps --ignore-scripts
21
 
22
+ # Rebuild sqlite3 native bindings
23
+ RUN npm rebuild sqlite3
24
+
25
+ # Build the project
26
+ RUN npm run build
27
 
28
+ # Expose the necessary port
29
  EXPOSE 8080
30
 
31
+ # Start the server
32
  CMD [ "node", "src/server.js" ]