StefanoDUrso commited on
Commit
3eed285
·
1 Parent(s): 8bc9cb2

docker + readme

Browse files
Files changed (1) hide show
  1. README.md +62 -0
README.md CHANGED
@@ -8,3 +8,65 @@ pinned: false
8
  ---
9
 
10
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  ---
9
 
10
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
11
+
12
+
13
+ STEPS:
14
+
15
+ Start by cloning this repo by using:
16
+
17
+ git clone https://huggingface.co/spaces/StefanoDUrso/Chainlit-docker
18
+ Create your Dockerfile file:
19
+
20
+ # read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
21
+ # you will also find guides on how best to write your Dockerfile
22
+
23
+ FROM python:3.9
24
+
25
+ WORKDIR /code
26
+
27
+ COPY ./requirements.txt /code/requirements.txt
28
+
29
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
30
+
31
+ COPY . .
32
+
33
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
34
+ Then commit and push:
35
+
36
+ git add Dockerfile
37
+ git commit -m "Add application file"
38
+ git push
39
+
40
+ ****** ATTENTION ******
41
+ Since October 2023 it is not possible to push using simply username and password: we need to generate a token at HuggingFace and perform the push accordingly: https://huggingface.co/blog/password-git-deprecation
42
+
43
+ If you don’t have any SSH keys on your machine, you can use ssh-keygen to generate a new SSH key pair (public + private keys):
44
+ ssh-keygen -t ed25519 -C "[email protected]"
45
+
46
+ Be sure that the OpenSSH service is STARTED
47
+
48
+ This generates the couple of keys in the current folder; better to move them into the standard ssh folder (in windows usually c:\users\MYUSERNAME\.ssh; in such scenario we will have something like c:\users\MYUSERNAME\.ssh\ed25519 and inside the pub and private key with the name chosen)
49
+
50
+ Once your new key is generated, add it to your SSH agent with ssh-add; let's assume we have a key with name id_ed25519 in the folder C:\users\paisl\.ssh\id_ed25519:
51
+ ssh-add "C:\users\paisl\.ssh\id_ed25519\id_ed25519"
52
+
53
+ To add a SSH key to your account, click on the “Add SSH key” button.
54
+
55
+ Then, enter a name for this key (for example, “Personal computer”), and copy and paste the content of your public SSH key in the area below. The public key is located in the ~/.ssh/id_XXXX.pub file you found or generated in the previous steps.
56
+
57
+ Click on “Add key”, and voilà! You have added a SSH key to your huggingface.co account.
58
+
59
+ >ssh -T [email protected]
60
+ The authenticity of host 'hf.co (...)' can't be established.
61
+ ED25519 key fingerprint is ...
62
+ This key is not known by any other names
63
+ Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
64
+ Warning: Permanently added 'hf.co' (ED25519) to the list of known hosts.
65
+ Hi StefanoDUrso, welcome to Hugging Face.
66
+
67
+ >ssh -T [email protected]
68
+ Hi ..., welcome to Hugging Face.
69
+
70
+ git remote set-url origin https://MY_GITHUB_NAME:[email protected]/spaces/MY_HUGGING_FACE_NAME/Chainlit-docker
71
+
72
+ git pull origin