[DEPLOYMENT-001] Fix WORKDIR issue with entrypoint script (fix) | ApprovalToken: AT-202512310745
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
@@ -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
9
docker/entrypoint.sh
Normal 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 "$@"
|
||||||
|
|
||||||
Reference in New Issue
Block a user