deploy at 2024-08-24 07:10:00.661397
Browse files- Dockerfile +10 -0
- main.py +11 -0
- requirements.txt +1 -0
Dockerfile
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.10
|
2 |
+
WORKDIR /code
|
3 |
+
COPY --link --chown=1000 . .
|
4 |
+
RUN mkdir -p /tmp/cache/
|
5 |
+
RUN chmod a+rwx -R /tmp/cache/
|
6 |
+
ENV HF_HUB_CACHE=HF_HOME
|
7 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
8 |
+
|
9 |
+
ENV PYTHONUNBUFFERED=1 PORT=7860
|
10 |
+
CMD ["python", "main.py"]
|
main.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fasthtml.common import *
|
2 |
+
from fasthtml_hf import setup_hf_backup
|
3 |
+
|
4 |
+
app,rt = fast_app()
|
5 |
+
|
6 |
+
@rt('/')
|
7 |
+
def get(): return Div(P('Hello World!'), hx_get="/change")
|
8 |
+
|
9 |
+
setup_hf_backup(app)
|
10 |
+
|
11 |
+
serve()
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
python-fasthtml
|