kopia lustrzana https://github.com/simonw/datasette
python app.py --build to generate build-metadata.json
This is now run by the Dockerfile to build this at compile time.pull/383/head
rodzic
b20d7119e4
commit
606ff9e35e
|
|
@ -2,5 +2,6 @@ FROM python:3
|
||||||
COPY . /app
|
COPY . /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN pip install -r requirements.txt
|
RUN pip install -r requirements.txt
|
||||||
|
RUN python app.py --build
|
||||||
EXPOSE 8006
|
EXPOSE 8006
|
||||||
CMD ["python", "app.py"]
|
CMD ["python", "app.py"]
|
||||||
|
|
|
||||||
6
app.py
6
app.py
|
|
@ -8,6 +8,7 @@ from pathlib import Path
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
import json
|
import json
|
||||||
import hashlib
|
import hashlib
|
||||||
|
import sys
|
||||||
|
|
||||||
app_root = Path(__file__).parent
|
app_root = Path(__file__).parent
|
||||||
|
|
||||||
|
|
@ -191,4 +192,7 @@ def resolve_db_name(db_name, **kwargs):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run(host="0.0.0.0", port=8006)
|
if '--build' in sys.argv:
|
||||||
|
ensure_build_metadata(True)
|
||||||
|
else:
|
||||||
|
app.run(host="0.0.0.0", port=8006)
|
||||||
|
|
|
||||||
Ładowanie…
Reference in New Issue