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; \
|
||||
|
||||
@@ -13,7 +13,7 @@ BACKEND_PORT = int(os.getenv("BACKEND_PORT", "8000"))
|
||||
DB_URL = os.getenv("DATABASE_URL", "sqlite:////app/data/reflex.db")
|
||||
|
||||
config = rx.Config(
|
||||
app_name="peikarband",
|
||||
app_name="src.presentation.web.pages.landing.index",
|
||||
api_url=API_URL,
|
||||
frontend_port=FRONTEND_PORT,
|
||||
backend_port=BACKEND_PORT,
|
||||
|
||||
Reference in New Issue
Block a user