feat: deploy both backend (3001) and frontend (3002) on shared Docker network for Dev; backend listens on 3001; robust for gitea server
Some checks failed
DevSecOps-Multibranch/pipeline/head There was a failure building this commit
Some checks failed
DevSecOps-Multibranch/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -25,10 +25,10 @@ USER nodeapp
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:3001/health || exit 1
|
||||
|
||||
# 2. Fix Expose to match the app
|
||||
EXPOSE 3000
|
||||
# Expose port 3001 for backend
|
||||
EXPOSE 3001
|
||||
|
||||
# Start the application
|
||||
CMD ["node", "server.js"]
|
||||
|
||||
@@ -19,7 +19,7 @@ const MONGODB_CONNECTION = 'mongodb://admin:supersecret123@localhost:27017/devdb
|
||||
const TWITTER_API_KEY = 'twitter_api_key_1234567890abcdef1234567890abcdef1234567890';
|
||||
|
||||
const app = express();
|
||||
const PORT = process.env.PORT || 3000;
|
||||
const PORT = process.env.PORT || 3001;
|
||||
|
||||
// Middleware
|
||||
app.use(cors());
|
||||
|
||||
Reference in New Issue
Block a user