fix(docker): fix Reflex module path and npm registry | ApprovalToken: 1767140126
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
- Set PYTHONPATH to /build for Reflex to find app module - Update app_name in rxconfig.py to match actual module path - Configure npm to use registry.npmjs.org instead of mirror - Add fallback from npm ci to npm install on failure - Fixes ModuleNotFoundError: Module peikarband.peikarband not found
This commit is contained in:
@@ -49,6 +49,9 @@ RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
# Copy source code
|
||||
COPY peikarband/ .
|
||||
|
||||
# Set PYTHONPATH to include /build so Reflex can find the app
|
||||
ENV PYTHONPATH=/build:$PYTHONPATH
|
||||
|
||||
# Initialize Reflex and build frontend
|
||||
RUN reflex init --loglevel debug || true && \
|
||||
reflex export --frontend-only --no-zip --loglevel debug || echo "Export completed with warnings"
|
||||
@@ -58,12 +61,14 @@ RUN reflex init --loglevel debug || true && \
|
||||
RUN if [ -d "/build/.web" ] && [ -f "/build/.web/package.json" ]; then \
|
||||
echo "Found .web directory with package.json, building frontend..." && \
|
||||
cd /build/.web && \
|
||||
npm config set registry https://registry.npmjs.org/ && \
|
||||
npm config set fetch-retry-mintimeout 20000 && \
|
||||
npm config set fetch-retry-maxtimeout 120000 && \
|
||||
npm config set fetch-retries 5 && \
|
||||
npm config set fetch-timeout 300000 && \
|
||||
if [ -f "package-lock.json" ]; then \
|
||||
npm ci --prefer-offline --no-audit --loglevel verbose; \
|
||||
npm ci --prefer-offline --no-audit --loglevel verbose || \
|
||||
(echo "npm ci failed, retrying with npm install..." && npm install --prefer-offline --no-audit --loglevel verbose); \
|
||||
else \
|
||||
echo "package-lock.json not found, using npm install..." && \
|
||||
npm install --prefer-offline --no-audit --loglevel verbose; \
|
||||
|
||||
Reference in New Issue
Block a user