Loic пре 1 дан
родитељ
комит
4060c2e6ae
7 измењених фајлова са 14 додато и 11 уклоњено
  1. 2 2
      .env.example
  2. 6 3
      backend/Dockerfile
  3. 1 1
      backend/server.js
  4. 2 2
      docker-compose.yml
  5. 1 1
      frontend/Dockerfile
  6. 1 1
      frontend/package.json
  7. 1 1
      frontend/src/App.js

+ 2 - 2
.env.example

@@ -8,8 +8,8 @@ POSTGRES_PASSWORD=password
 POSTGRES_DB=byop_sample
 
 # Backend configuration
-PORT=5000
+PORT=4000
 JWT_SECRET=your-development-secret-key-change-in-production
 
 # Frontend configuration  
-REACT_APP_API_URL=http://localhost:5000
+REACT_APP_API_URL=http://localhost:4000

+ 6 - 3
backend/Dockerfile

@@ -2,11 +2,14 @@ FROM node:18-alpine
 
 WORKDIR /app
 
+# Install curl for health check
+RUN apk add --no-cache curl
+
 # Copy package files
 COPY package*.json ./
 
 # Install dependencies
-RUN npm ci --only=production
+RUN npm install --only=production
 
 # Copy source code
 COPY . .
@@ -20,11 +23,11 @@ RUN chown -R nodejs:nodejs /app
 USER nodejs
 
 # Expose port
-EXPOSE 5000
+EXPOSE 4000
 
 # Health check
 HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
-  CMD curl -f http://localhost:5000/health || exit 1
+  CMD curl -f http://localhost:4000/health || exit 1
 
 # Start the application
 CMD ["npm", "start"]

+ 1 - 1
backend/server.js

@@ -6,7 +6,7 @@ const { Pool } = require('pg');
 require('dotenv').config();
 
 const app = express();
-const PORT = process.env.PORT || 5000;
+const PORT = process.env.PORT || 4000;
 
 // Database configuration
 const pool = new Pool({

+ 2 - 2
docker-compose.yml

@@ -9,7 +9,7 @@ services:
     ports:
       - "3000:3000"
     environment:
-      - REACT_APP_API_URL=http://backend:5000
+      - REACT_APP_API_URL=http://backend:4000
     depends_on:
       - backend
     networks:
@@ -21,7 +21,7 @@ services:
       context: ./backend
       dockerfile: Dockerfile
     ports:
-      - "5000:5000"
+      - "4000:4000"
     environment:
       - NODE_ENV=development
       - DATABASE_URL=postgresql://postgres:password@database:5432/byop_sample

+ 1 - 1
frontend/Dockerfile

@@ -5,7 +5,7 @@ WORKDIR /app
 
 # Copy package files
 COPY package*.json ./
-RUN npm ci --only=production
+RUN npm install
 
 # Copy source code
 COPY . .

+ 1 - 1
frontend/package.json

@@ -37,5 +37,5 @@
       "last 1 safari version"
     ]
   },
-  "proxy": "http://localhost:5000"
+  "proxy": "http://localhost:4000"
 }

+ 1 - 1
frontend/src/App.js

@@ -1,7 +1,7 @@
 import React, { useState, useEffect } from 'react';
 import axios from 'axios';
 
-const API_URL = process.env.REACT_APP_API_URL || 'http://localhost:5000';
+const API_URL = process.env.REACT_APP_API_URL || 'http://localhost:4000';
 
 function App() {
   const [users, setUsers] = useState([]);