Spaces:
Sleeping
Sleeping
GPTfree api
commited on
Update Dockerfile
Browse files- Dockerfile +15 -9
Dockerfile
CHANGED
@@ -1,26 +1,32 @@
|
|
1 |
-
# Use Node.js 16
|
2 |
FROM node:16
|
3 |
|
4 |
-
# Set the working directory
|
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
|
11 |
RUN rm -rf package-lock.json node_modules
|
12 |
|
13 |
-
# Ensure npm is
|
14 |
RUN npm install -g [email protected]
|
15 |
|
16 |
-
# Install dependencies
|
17 |
RUN npm install --legacy-peer-deps --ignore-scripts
|
18 |
|
19 |
-
#
|
20 |
-
RUN npm
|
|
|
|
|
|
|
21 |
|
22 |
-
# Expose the necessary port
|
23 |
EXPOSE 8080
|
24 |
|
25 |
-
# Start the
|
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" ]
|