diff --git a/docker/Dockerfile b/docker/Dockerfile index 9fa3082..ce70d2c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -50,16 +50,16 @@ RUN --mount=type=cache,target=/root/.cache/pip \ COPY peikarband/ . # Set PYTHONPATH to include /build so Reflex can find the app -ENV PYTHONPATH=/build:$PYTHONPATH +ENV PYTHONPATH=/build # Initialize Reflex and build frontend RUN reflex init --loglevel debug || true && \ reflex export --frontend-only --no-zip --loglevel debug || echo "Export completed with warnings" -# Build frontend with npm (fallback if reflex export fails) -# Check if .web directory exists and has package.json +# Install npm dependencies if .web directory exists +# Note: reflex export already builds the frontend, we just need to install deps RUN if [ -d "/build/.web" ] && [ -f "/build/.web/package.json" ]; then \ - echo "Found .web directory with package.json, building frontend..." && \ + echo "Found .web directory with package.json, installing dependencies..." && \ cd /build/.web && \ # Remove any existing .npmrc that might override registry rm -f .npmrc && \ @@ -71,6 +71,7 @@ RUN if [ -d "/build/.web" ] && [ -f "/build/.web/package.json" ]; then \ npm config set fetch-timeout 300000 && \ # Verify registry is set correctly echo "Using npm registry: $(npm config get registry)" && \ + # Install dependencies (reflex export already built the frontend) if [ -f "package-lock.json" ]; then \ npm ci --prefer-offline --no-audit --loglevel verbose || \ (echo "npm ci failed, retrying with npm install..." && npm install --prefer-offline --no-audit --loglevel verbose); \ @@ -78,9 +79,9 @@ RUN if [ -d "/build/.web" ] && [ -f "/build/.web/package.json" ]; then \ echo "package-lock.json not found, using npm install..." && \ npm install --prefer-offline --no-audit --loglevel verbose; \ fi && \ - npm run build; \ + echo "Dependencies installed successfully"; \ else \ - echo "Warning: .web directory or package.json not found, skipping npm build"; \ + echo "Warning: .web directory or package.json not found, skipping npm install"; \ fi # ============================================