vishalbakshi commited on
Commit
54f55cf
·
verified ·
1 Parent(s): 8cc752c

deploy at 2024-08-23 20:18:37.670595

Browse files
Files changed (3) hide show
  1. Dockerfile +10 -0
  2. main.py +11 -0
  3. requirements.txt +2 -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_hf import setup_hf_backup
2
+ from fasthtml.common import *
3
+
4
+
5
+ app,rt = fast_app()
6
+
7
+ @rt('/')
8
+ def get(): return Div(P('Hello World!'), hx_get="/change")
9
+
10
+ setup_hf_backup(app)
11
+ serve()
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ python-fasthtml
2
+ fasthtml-hf