kamiwork commited on
Commit
d5344d6
·
verified ·
1 Parent(s): 67772b9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -9
Dockerfile CHANGED
@@ -3,16 +3,20 @@ FROM traffmonetizer/cli_v2:latest
3
  RUN apk add --no-cache nodejs npm
4
 
5
  WORKDIR /app
6
- COPY package.json index.js ./
 
 
 
 
 
 
 
 
 
 
 
7
  RUN npm install --omit=dev
8
 
9
  EXPOSE 7860
10
 
11
- # Using backslash for multi-line (works in Docker)
12
- CMD ["sh", "-c", "\
13
- echo '🚀 Starting TraffMonetizer...' && \
14
- start accept --token $TOKEN & \
15
- echo '✅ TraffMonetizer started in background' && \
16
- echo '🚀 Starting Express server...' && \
17
- exec node index.js \
18
- "]
 
3
  RUN apk add --no-cache nodejs npm
4
 
5
  WORKDIR /app
6
+
7
+ # Debug version of index.js
8
+ RUN echo "const express = require('express'); \
9
+ const app = express(); \
10
+ const port = 7860; \
11
+ console.log('DEBUG: Starting server on port', port); \
12
+ app.get('/', (req, res) => res.send('TEST')); \
13
+ app.listen(port, '0.0.0.0', () => console.log('DEBUG: Server started'));" > index.js
14
+
15
+ # Debug package.json
16
+ RUN echo '{"dependencies":{"express":"^4.18.2"}}' > package.json
17
+
18
  RUN npm install --omit=dev
19
 
20
  EXPOSE 7860
21
 
22
+ CMD ["sh", "-c", "echo 'DEBUG: TOKEN is set: '${TOKEN:+YES}'; start accept --token $TOKEN & node index.js"]