mirror of
https://git.victorphan.net/basketballcantho/ten-project.git
synced 2026-08-05 10:03:11 +07:00
update port phù hợp là 8001 và 3011
This commit is contained in:
+1
-1
@@ -16,7 +16,7 @@ ACCESS_TOKEN_EXPIRE_MINUTES=60
|
|||||||
|
|
||||||
# ── Ports ─────────────────────────────────────────────────────────────────────
|
# ── Ports ─────────────────────────────────────────────────────────────────────
|
||||||
# Port exposed on the host for the Next.js frontend
|
# 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) ───────────────
|
# ── Docker Hub images (optional — leave blank to build locally) ───────────────
|
||||||
# Set these on the target machine so docker compose pull works without building
|
# Set these on the target machine so docker compose pull works without building
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ echo "⏳ Running Alembic migrations..."
|
|||||||
alembic upgrade head
|
alembic upgrade head
|
||||||
|
|
||||||
echo "🚀 Starting FastAPI..."
|
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
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ done
|
|||||||
# ─────────────────────────────────────────────────────────────────────────────
|
# ─────────────────────────────────────────────────────────────────────────────
|
||||||
# Summary
|
# Summary
|
||||||
# ─────────────────────────────────────────────────────────────────────────────
|
# ─────────────────────────────────────────────────────────────────────────────
|
||||||
PORT="${FRONTEND_PORT:-3000}"
|
PORT="${FRONTEND_PORT:-3011}"
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "${BOLD}${GREEN}══════════════════════════════════════════${RESET}"
|
echo -e "${BOLD}${GREEN}══════════════════════════════════════════${RESET}"
|
||||||
echo -e "${BOLD}${GREEN} ✅ LMS is up!${RESET}"
|
echo -e "${BOLD}${GREEN} ✅ LMS is up!${RESET}"
|
||||||
|
|||||||
@@ -38,5 +38,5 @@ echo "🚀 Starting stack..."
|
|||||||
docker compose up -d
|
docker compose up -d
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "✅ Running! Open http://localhost:${FRONTEND_PORT:-3000}"
|
echo "✅ Running! Open http://localhost:${FRONTEND_PORT:-3011}"
|
||||||
docker compose ps
|
docker compose ps
|
||||||
|
|||||||
+4
-4
@@ -53,7 +53,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- pdf_uploads:/uploads
|
- pdf_uploads:/uploads
|
||||||
expose:
|
expose:
|
||||||
- "8000"
|
- "8001"
|
||||||
networks:
|
networks:
|
||||||
- lms_net
|
- lms_net
|
||||||
|
|
||||||
@@ -64,15 +64,15 @@ services:
|
|||||||
context: ./frontend
|
context: ./frontend
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
args:
|
args:
|
||||||
NEXT_PUBLIC_API_URL: http://backend:8000
|
NEXT_PUBLIC_API_URL: http://backend:8001
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
- backend
|
||||||
environment:
|
environment:
|
||||||
NEXT_PUBLIC_API_URL: http://backend:8000
|
NEXT_PUBLIC_API_URL: http://backend:8001
|
||||||
NODE_ENV: production
|
NODE_ENV: production
|
||||||
ports:
|
ports:
|
||||||
- "${FRONTEND_PORT:-3000}:3000"
|
- "${FRONTEND_PORT:-3011}:3011"
|
||||||
networks:
|
networks:
|
||||||
- lms_net
|
- lms_net
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -13,7 +13,7 @@ COPY --from=deps /app/node_modules ./node_modules
|
|||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# NEXT_PUBLIC_API_URL is baked in at build time via docker-compose build args
|
# 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
|
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
|
||||||
|
|
||||||
RUN mkdir -p /app/public && npm run build
|
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/static ./.next/static
|
||||||
COPY --from=builder /app/next.config.js ./
|
COPY --from=builder /app/next.config.js ./
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3011
|
||||||
|
|
||||||
|
ENV PORT=3011
|
||||||
|
|
||||||
CMD ["node", "server.js"]
|
CMD ["node", "server.js"]
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ const nextConfig = {
|
|||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
source: "/api/:path*",
|
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*",
|
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*`,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user