[DEPLOYMENT-001] Fix container structure to preserve peikarband.peikarband module path (fix) | ApprovalToken: AT-202512310616
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
@@ -130,9 +130,9 @@ WORKDIR /app
|
||||
COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
|
||||
COPY --from=builder /usr/local/bin /usr/local/bin
|
||||
|
||||
# Copy application code directly to /app/ to preserve package structure
|
||||
# This ensures peikarband.peikarband module can be found by Reflex
|
||||
COPY --from=builder --chown=peikarband:peikarband /build/peikarband /app
|
||||
# Copy application code to /app/peikarband/ to create peikarband.peikarband structure
|
||||
# With app_name="peikarband", Reflex expects to find peikarband.peikarband module
|
||||
COPY --from=builder --chown=peikarband:peikarband /build/peikarband /app/peikarband
|
||||
|
||||
# Create necessary directories
|
||||
RUN mkdir -p /app/data /app/logs /app/uploaded_files && \
|
||||
@@ -144,14 +144,14 @@ RUN chmod -R 755 /app && \
|
||||
|
||||
# Environment variables
|
||||
# PYTHONPATH=/app allows importing peikarband package from /app/peikarband/
|
||||
# and src.* imports from /app/src/
|
||||
# and peikarband.peikarband from /app/peikarband/peikarband/
|
||||
# Note: Python adds current directory (.) to sys.path automatically, but PYTHONPATH entries come first
|
||||
# REFLEX_DIR points to the directory containing rxconfig.py
|
||||
ENV PYTHONUNBUFFERED=1 \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONPATH=/app \
|
||||
PYTHONPATH=/app:/app/peikarband \
|
||||
PATH="/app/.venv/bin:$PATH" \
|
||||
REFLEX_DIR=/app \
|
||||
REFLEX_DIR=/app/peikarband \
|
||||
NODE_ENV=production
|
||||
|
||||
# Health check
|
||||
@@ -168,8 +168,9 @@ EXPOSE 3000 8000
|
||||
ENTRYPOINT ["/usr/bin/tini", "--"]
|
||||
|
||||
# Start application
|
||||
# Reflex will run from /app where rxconfig.py is located
|
||||
# PYTHONPATH=/app allows Python to find peikarband package for imports
|
||||
# Reflex will run from /app/peikarband where rxconfig.py is located
|
||||
# PYTHONPATH=/app:/app/peikarband allows Python to find both peikarband and peikarband.peikarband
|
||||
WORKDIR /app/peikarband
|
||||
CMD ["reflex", "run", "--env", "prod", "--loglevel", "info", "--frontend-port", "3000", "--backend-port", "8000"]
|
||||
|
||||
# ============================================
|
||||
|
||||
Reference in New Issue
Block a user