[DEPLOYMENT-001] Fix WORKDIR issue with entrypoint script (fix) | ApprovalToken: AT-202512310745
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
Ehsan.Asadi
2025-12-31 07:45:36 +03:30
parent ed1d18ce94
commit cd5960e426
2 changed files with 16 additions and 4 deletions

View File

@@ -134,6 +134,10 @@ COPY --from=builder /usr/local/bin /usr/local/bin
# With app_name="peikarband", Reflex expects to find peikarband.peikarband module # With app_name="peikarband", Reflex expects to find peikarband.peikarband module
COPY --from=builder --chown=peikarband:peikarband /build/peikarband /app/peikarband COPY --from=builder --chown=peikarband:peikarband /build/peikarband /app/peikarband
# Copy entrypoint script
COPY docker/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
# 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 && \
chown -R peikarband:peikarband /app chown -R peikarband:peikarband /app
@@ -166,13 +170,12 @@ USER peikarband
EXPOSE 3000 8000 EXPOSE 3000 8000
# Use tini as init system # Use tini as init system
ENTRYPOINT ["/usr/bin/tini", "--"] ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/entrypoint.sh"]
# Start application # Start application
# Reflex will run from /app/peikarband where rxconfig.py is located # entrypoint.sh will cd to /app/peikarband and run reflex
# PYTHONPATH=/app:/app/peikarband allows Python to find both peikarband and peikarband.peikarband # PYTHONPATH=/app:/app/peikarband allows Python to find both peikarband and peikarband.peikarband
WORKDIR /app/peikarband CMD ["run", "--env", "prod", "--loglevel", "info", "--frontend-port", "3000", "--backend-port", "8000"]
CMD ["reflex", "run", "--env", "prod", "--loglevel", "info", "--frontend-port", "3000", "--backend-port", "8000"]
# ============================================ # ============================================
# Build Information # Build Information

9
docker/entrypoint.sh Normal file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
set -e
# Change to the directory containing rxconfig.py
cd /app/peikarband
# Run reflex with all passed arguments
exec reflex "$@"