[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/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
|
||||||
COPY --from=builder /usr/local/bin /usr/local/bin
|
COPY --from=builder /usr/local/bin /usr/local/bin
|
||||||
|
|
||||||
# Copy application code directly to /app/ to preserve package structure
|
# Copy application code to /app/peikarband/ to create peikarband.peikarband structure
|
||||||
# This ensures peikarband.peikarband module can be found by Reflex
|
# With app_name="peikarband", Reflex expects to find peikarband.peikarband module
|
||||||
COPY --from=builder --chown=peikarband:peikarband /build/peikarband /app
|
COPY --from=builder --chown=peikarband:peikarband /build/peikarband /app/peikarband
|
||||||
|
|
||||||
# Create necessary directories
|
# Create necessary directories
|
||||||
RUN mkdir -p /app/data /app/logs /app/uploaded_files && \
|
RUN mkdir -p /app/data /app/logs /app/uploaded_files && \
|
||||||
@@ -144,14 +144,14 @@ RUN chmod -R 755 /app && \
|
|||||||
|
|
||||||
# Environment variables
|
# Environment variables
|
||||||
# PYTHONPATH=/app allows importing peikarband package from /app/peikarband/
|
# 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
|
# Note: Python adds current directory (.) to sys.path automatically, but PYTHONPATH entries come first
|
||||||
# REFLEX_DIR points to the directory containing rxconfig.py
|
# REFLEX_DIR points to the directory containing rxconfig.py
|
||||||
ENV PYTHONUNBUFFERED=1 \
|
ENV PYTHONUNBUFFERED=1 \
|
||||||
PYTHONDONTWRITEBYTECODE=1 \
|
PYTHONDONTWRITEBYTECODE=1 \
|
||||||
PYTHONPATH=/app \
|
PYTHONPATH=/app:/app/peikarband \
|
||||||
PATH="/app/.venv/bin:$PATH" \
|
PATH="/app/.venv/bin:$PATH" \
|
||||||
REFLEX_DIR=/app \
|
REFLEX_DIR=/app/peikarband \
|
||||||
NODE_ENV=production
|
NODE_ENV=production
|
||||||
|
|
||||||
# Health check
|
# Health check
|
||||||
@@ -168,8 +168,9 @@ EXPOSE 3000 8000
|
|||||||
ENTRYPOINT ["/usr/bin/tini", "--"]
|
ENTRYPOINT ["/usr/bin/tini", "--"]
|
||||||
|
|
||||||
# Start application
|
# Start application
|
||||||
# Reflex will run from /app where rxconfig.py is located
|
# Reflex will run from /app/peikarband where rxconfig.py is located
|
||||||
# PYTHONPATH=/app allows Python to find peikarband package for imports
|
# 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"]
|
CMD ["reflex", "run", "--env", "prod", "--loglevel", "info", "--frontend-port", "3000", "--backend-port", "8000"]
|
||||||
|
|
||||||
# ============================================
|
# ============================================
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ BACKEND_PORT = int(os.getenv("BACKEND_PORT", "8000"))
|
|||||||
DB_URL = os.getenv("DATABASE_URL", "sqlite:////app/data/reflex.db")
|
DB_URL = os.getenv("DATABASE_URL", "sqlite:////app/data/reflex.db")
|
||||||
|
|
||||||
config = rx.Config(
|
config = rx.Config(
|
||||||
app_name="app",
|
app_name="peikarband",
|
||||||
api_url=API_URL,
|
api_url=API_URL,
|
||||||
frontend_port=FRONTEND_PORT,
|
frontend_port=FRONTEND_PORT,
|
||||||
backend_port=BACKEND_PORT,
|
backend_port=BACKEND_PORT,
|
||||||
|
|||||||
Reference in New Issue
Block a user