update port phù hợp là 8001 và 3011

This commit is contained in:
2026-04-02 10:33:05 +07:00
parent 088b03c36f
commit a571438459
7 changed files with 14 additions and 12 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ ACCESS_TOKEN_EXPIRE_MINUTES=60
# ── Ports ─────────────────────────────────────────────────────────────────────
# Port exposed on the host for the Next.js frontend
FRONTEND_PORT=3000
FRONTEND_PORT=3011
# ── Docker Hub images (optional — leave blank to build locally) ───────────────
# Set these on the target machine so docker compose pull works without building
+1 -1
View File
@@ -6,4 +6,4 @@ echo "⏳ Running Alembic migrations..."
alembic upgrade head
echo "🚀 Starting FastAPI..."
exec uvicorn main:app --host 0.0.0.0 --port 8000
exec uvicorn main:app --host 0.0.0.0 --port 8001
+1 -1
View File
@@ -163,7 +163,7 @@ done
# ─────────────────────────────────────────────────────────────────────────────
# Summary
# ─────────────────────────────────────────────────────────────────────────────
PORT="${FRONTEND_PORT:-3000}"
PORT="${FRONTEND_PORT:-3011}"
echo ""
echo -e "${BOLD}${GREEN}══════════════════════════════════════════${RESET}"
echo -e "${BOLD}${GREEN} ✅ LMS is up!${RESET}"
+1 -1
View File
@@ -38,5 +38,5 @@ echo "🚀 Starting stack..."
docker compose up -d
echo ""
echo "✅ Running! Open http://localhost:${FRONTEND_PORT:-3000}"
echo "✅ Running! Open http://localhost:${FRONTEND_PORT:-3011}"
docker compose ps
+4 -4
View File
@@ -53,7 +53,7 @@ services:
volumes:
- pdf_uploads:/uploads
expose:
- "8000"
- "8001"
networks:
- lms_net
@@ -64,15 +64,15 @@ services:
context: ./frontend
dockerfile: Dockerfile
args:
NEXT_PUBLIC_API_URL: http://backend:8000
NEXT_PUBLIC_API_URL: http://backend:8001
restart: unless-stopped
depends_on:
- backend
environment:
NEXT_PUBLIC_API_URL: http://backend:8000
NEXT_PUBLIC_API_URL: http://backend:8001
NODE_ENV: production
ports:
- "${FRONTEND_PORT:-3000}:3000"
- "${FRONTEND_PORT:-3011}:3011"
networks:
- lms_net
+4 -2
View File
@@ -13,7 +13,7 @@ COPY --from=deps /app/node_modules ./node_modules
COPY . .
# NEXT_PUBLIC_API_URL is baked in at build time via docker-compose build args
ARG NEXT_PUBLIC_API_URL=http://backend:8000
ARG NEXT_PUBLIC_API_URL=http://backend:8001
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
RUN mkdir -p /app/public && npm run build
@@ -32,6 +32,8 @@ COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/next.config.js ./
EXPOSE 3000
EXPOSE 3011
ENV PORT=3011
CMD ["node", "server.js"]
+2 -2
View File
@@ -5,11 +5,11 @@ const nextConfig = {
return [
{
source: "/api/:path*",
destination: `${process.env.NEXT_PUBLIC_API_URL ?? "http://localhost:8000"}/api/:path*`,
destination: `${process.env.NEXT_PUBLIC_API_URL ?? "http://localhost:8001"}/api/:path*`,
},
{
source: "/ws/:path*",
destination: `${process.env.NEXT_PUBLIC_API_URL ?? "http://localhost:8000"}/ws/:path*`,
destination: `${process.env.NEXT_PUBLIC_API_URL ?? "http://localhost:8001"}/ws/:path*`,
},
];
},