fix: update Dockerfile and start script for simplified frontend structure
Browse files- Dockerfile +8 -8
- start.sh +1 -1
Dockerfile
CHANGED
|
@@ -3,11 +3,11 @@ FROM oven/bun:latest as frontend-builder
|
|
| 3 |
# Set working directory for frontend
|
| 4 |
WORKDIR /build
|
| 5 |
# Copy frontend package files from the correct path
|
| 6 |
-
COPY frontend/
|
| 7 |
# Install ALL dependencies (including Next.js)
|
| 8 |
RUN bun install
|
| 9 |
# Copy frontend source
|
| 10 |
-
COPY frontend/
|
| 11 |
# Build the Next.js app
|
| 12 |
RUN bun run build
|
| 13 |
|
|
@@ -25,14 +25,14 @@ RUN bun install --production
|
|
| 25 |
COPY --chown=1000:1000 src/ ./src/
|
| 26 |
|
| 27 |
# Create frontend directory structure
|
| 28 |
-
RUN mkdir -p ./frontend
|
| 29 |
|
| 30 |
# Copy built Next.js app AND node_modules from builder stage
|
| 31 |
-
COPY --from=frontend-builder --chown=1000:1000 /build/.next ./frontend
|
| 32 |
-
COPY --from=frontend-builder --chown=1000:1000 /build/public ./frontend/
|
| 33 |
-
COPY --from=frontend-builder --chown=1000:1000 /build/package.json ./frontend/
|
| 34 |
-
COPY --from=frontend-builder --chown=1000:1000 /build/next.config.mjs ./frontend/
|
| 35 |
-
COPY --from=frontend-builder --chown=1000:1000 /build/node_modules ./frontend/
|
| 36 |
|
| 37 |
# Create necessary directories and set permissions
|
| 38 |
RUN mkdir -p /app/logs /app/temp
|
|
|
|
| 3 |
# Set working directory for frontend
|
| 4 |
WORKDIR /build
|
| 5 |
# Copy frontend package files from the correct path
|
| 6 |
+
COPY frontend/package.json frontend/bun.lockb* ./
|
| 7 |
# Install ALL dependencies (including Next.js)
|
| 8 |
RUN bun install
|
| 9 |
# Copy frontend source
|
| 10 |
+
COPY frontend/ ./
|
| 11 |
# Build the Next.js app
|
| 12 |
RUN bun run build
|
| 13 |
|
|
|
|
| 25 |
COPY --chown=1000:1000 src/ ./src/
|
| 26 |
|
| 27 |
# Create frontend directory structure
|
| 28 |
+
RUN mkdir -p ./frontend
|
| 29 |
|
| 30 |
# Copy built Next.js app AND node_modules from builder stage
|
| 31 |
+
COPY --from=frontend-builder --chown=1000:1000 /build/.next ./frontend/.next
|
| 32 |
+
COPY --from=frontend-builder --chown=1000:1000 /build/public ./frontend/public
|
| 33 |
+
COPY --from=frontend-builder --chown=1000:1000 /build/package.json ./frontend/package.json
|
| 34 |
+
COPY --from=frontend-builder --chown=1000:1000 /build/next.config.mjs ./frontend/next.config.mjs
|
| 35 |
+
COPY --from=frontend-builder --chown=1000:1000 /build/node_modules ./frontend/node_modules
|
| 36 |
|
| 37 |
# Create necessary directories and set permissions
|
| 38 |
RUN mkdir -p /app/logs /app/temp
|
start.sh
CHANGED
|
@@ -13,7 +13,7 @@ trap cleanup SIGTERM SIGINT
|
|
| 13 |
|
| 14 |
# Start Next.js frontend in the background on port 7860
|
| 15 |
echo "Starting LumaKit Frontend on port 7860..."
|
| 16 |
-
cd /app/frontend
|
| 17 |
FRONTEND_PID=$!
|
| 18 |
echo "Frontend started with PID: $FRONTEND_PID"
|
| 19 |
|
|
|
|
| 13 |
|
| 14 |
# Start Next.js frontend in the background on port 7860
|
| 15 |
echo "Starting LumaKit Frontend on port 7860..."
|
| 16 |
+
cd /app/frontend && PORT=7860 bunx next start &
|
| 17 |
FRONTEND_PID=$!
|
| 18 |
echo "Frontend started with PID: $FRONTEND_PID"
|
| 19 |
|