v1.2
This commit is contained in:
@@ -14,5 +14,7 @@ COPY . .
|
||||
|
||||
EXPOSE 5000
|
||||
|
||||
# Keep testing and local dev via `flask` if desired; docker runs the app directly.
|
||||
CMD ["python", "app.py"]
|
||||
# Use Gunicorn (production WSGI server) in Docker.
|
||||
# We keep the container compatible with the PORT env var used in docker-compose.
|
||||
# JSON-form CMD doesn't expand env vars, so we use a shell form here.
|
||||
CMD ["sh", "-c", "gunicorn --bind 0.0.0.0:${PORT:-5000} --workers 2 --threads 4 app:app"]
|
||||
|
||||
@@ -48,6 +48,8 @@ Then run:
|
||||
docker compose up --build
|
||||
```
|
||||
|
||||
Docker runs the app using **Gunicorn** (production WSGI server).
|
||||
|
||||
Open: http://127.0.0.1:5000
|
||||
|
||||
## Release (git + docker)
|
||||
|
||||
7
app.py
7
app.py
@@ -131,7 +131,12 @@ def create_app() -> Flask:
|
||||
return app
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# WSGI entrypoint for production servers like Gunicorn.
|
||||
# Gunicorn will look for a module-level callable named `app` by default when
|
||||
# you run `gunicorn app:app`.
|
||||
app = create_app()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# For production: use a proper WSGI server (gunicorn/uwsgi).
|
||||
app.run(host="0.0.0.0", port=int(os.environ.get("PORT", "5000")), debug=True)
|
||||
|
||||
@@ -4,4 +4,4 @@ This module exists so the running application and/or deployments can introspect
|
||||
which version is currently deployed.
|
||||
"""
|
||||
|
||||
VERSION = "1.1"
|
||||
VERSION = "v1.2"
|
||||
@@ -1,3 +1,4 @@
|
||||
Flask==3.0.3
|
||||
feedparser==6.0.11
|
||||
requests==2.32.3
|
||||
gunicorn==22.0.0
|
||||
Reference in New Issue
Block a user