fix: اصلاح Dockerfile و server.js برای اجرای صحیح API
This commit is contained in:
@@ -9,4 +9,4 @@ COPY . .
|
||||
|
||||
EXPOSE 3002
|
||||
|
||||
CMD ["node", "index.js"]
|
||||
CMD ["node", "server.js"]
|
||||
|
||||
12
Dockerfile.backup
Normal file
12
Dockerfile.backup
Normal 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"]
|
||||
@@ -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}`)
|
||||
|
||||
Reference in New Issue
Block a user