Lägg till stöd för docker
This commit is contained in:
parent
2f099575fd
commit
d125efebb0
7
.dockerignore
Normal file
7
.dockerignore
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
.pytest_cache/
|
||||||
|
venv/
|
||||||
|
.git/
|
||||||
|
.DS_Store
|
||||||
|
todo.db
|
||||||
14
Dockerfile
Normal file
14
Dockerfile
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
FROM python:3.12-slim
|
||||||
|
|
||||||
|
ENV PYTHONDONTWRITEBYTECODE=1
|
||||||
|
ENV PYTHONUNBUFFERED=1
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY requirements.txt /app/requirements.txt
|
||||||
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
COPY . /app
|
||||||
|
EXPOSE 5001
|
||||||
|
|
||||||
|
CMD ["python", "app.py"]
|
||||||
3
app.py
3
app.py
@ -160,4 +160,5 @@ def create_app(test_config: dict | None = None) -> Flask:
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app = create_app()
|
app = create_app()
|
||||||
app.run(host="127.0.0.1", port=5001, debug=True)
|
debug = os.environ.get("FLASK_DEBUG", "0") == "1"
|
||||||
|
app.run(host="0.0.0.0", port=5001, debug=debug)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user