Skip to content

Containerize Coletor Fiscal and harden Streamlit bootstrap#13

Open
ademirrodrigo wants to merge 1 commit intomainfrom
codex/create-coletor-fiscal-v3.2-saas-ready-system-o8xmnd
Open

Containerize Coletor Fiscal and harden Streamlit bootstrap#13
ademirrodrigo wants to merge 1 commit intomainfrom
codex/create-coletor-fiscal-v3.2-saas-ready-system-o8xmnd

Conversation

@ademirrodrigo
Copy link
Owner

Summary

  • add Dockerfile, docker-compose, and entrypoint script to run the platform in containers with mounted data directories
  • refresh configuration, README, and environment defaults to document Docker usage while keeping existing install scripts
  • stabilize the Streamlit frontend imports and logging by normalizing sys.path and exposing new settings helpers

Testing

  • python -m compileall app web

https://chatgpt.com/codex/tasks/task_e_6900d155dee88329a267792bed0f790b

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


from .config import settings

engine = create_engine(settings.database_url, connect_args={"check_same_thread": False})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Guard check_same_thread for non-SQLite engines

app/database.py always builds the SQLAlchemy engine with connect_args={"check_same_thread": False}. That keyword exists only for SQLite; if a user sets DATABASE_URL to Postgres or any other backend (as encouraged in the README), the driver raises TypeError: connect() got an unexpected keyword argument 'check_same_thread' and the application fails during startup. Only pass this option when the URL scheme is SQLite or drop it entirely for external databases.

Useful? React with 👍 / 👎.

WorkingDirectory=${APP_DIR}
Environment="PYTHONPATH=${APP_DIR}"
EnvironmentFile=${APP_DIR}/.env
ExecStart=${VENV_DIR}/bin/streamlit run ${APP_DIR}/web/app.py --server.port \${PORTA:-8501} --server.address 0.0.0.0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Expand service PORTA before writing ExecStart

The install.sh script writes a systemd unit whose ExecStart includes --server.port \${PORTA:-8501}. systemd does not interpret the shell :- default syntax, so the expression is left untouched (or expands to an empty string), and Streamlit receives an invalid port argument and exits immediately. Use a simple $PORTA and set a default via Environment=PORTA=8501, or run the command through a shell to perform the expansion.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant