Containerize Coletor Fiscal and harden Streamlit bootstrap#13
Containerize Coletor Fiscal and harden Streamlit bootstrap#13ademirrodrigo wants to merge 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
💡 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}) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_6900d155dee88329a267792bed0f790b