fix: اصلاح Dockerfile و server.js برای اجرای صحیح API

This commit is contained in:
root
2026-07-05 18:55:13 +03:30
parent 9df7e919c5
commit 089971fcdf
3 changed files with 20 additions and 2 deletions

View File

@@ -9,4 +9,4 @@ COPY . .
EXPOSE 3002
CMD ["node", "index.js"]
CMD ["node", "server.js"]

12
Dockerfile.backup Normal file
View File

@@ -0,0 +1,12 @@
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install --production
COPY . .
EXPOSE 3002
CMD ["node", "index.js"]

View File

@@ -1,3 +1,9 @@
require('dotenv').config()
console.log('APP_PORT:', process.env.APP_PORT)
const bootApplication = require('./index')
bootApplication(process.env.APP_PORT)
console.log('Index loaded, booting...')
const port = process.env.APP_PORT || 3002
bootApplication(port)
console.log(`✅ Server should be running on port ${port}`)