wojtek-opentensor commited on
Commit
73617f9
·
1 Parent(s): 852435a

Create dockerfile for prompting-api

Browse files
Files changed (2) hide show
  1. Dockerfile +10 -0
  2. README.md +13 -0
Dockerfile ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-bookworm
2
+
3
+ COPY . /app
4
+ WORKDIR /app
5
+
6
+ EXPOSE 10000
7
+ RUN pip install -r requirements.txt
8
+
9
+ ENTRYPOINT ["python", "server.py"]
10
+
README.md CHANGED
@@ -72,6 +72,19 @@ We recommend that you run the server using a process manager like PM2. This will
72
  EXPECTED_ACCESS_KEY=<ACCESS_KEY> pm2 start server.py --interpreter python3 --name sn1-api -- --wallet.name <WALLET_NAME> --wallet.hotkey <WALLET_HOTKEY> --netuid <NETUID> --neuron.model_id mock --neuron.tasks math --neuron.task_p 1 --neuron.device cpu
73
  ```
74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  ## API Usage
76
  At present, the API provides two endpoints: `/chat` (live) and `/echo` (test).
77
 
 
72
  EXPECTED_ACCESS_KEY=<ACCESS_KEY> pm2 start server.py --interpreter python3 --name sn1-api -- --wallet.name <WALLET_NAME> --wallet.hotkey <WALLET_HOTKEY> --netuid <NETUID> --neuron.model_id mock --neuron.tasks math --neuron.task_p 1 --neuron.device cpu
73
  ```
74
 
75
+ ### Run with Docker
76
+
77
+ To run api in docker container you have to build the image:
78
+ ```
79
+ docker build . -t prompting-api
80
+ ```
81
+ after the image is build properly
82
+ you can start it with command:
83
+
84
+ ```
85
+ docker run -e EXPECTED_ACCESS_KEY=<ACCESS_KEY> prompting-api:latest --interpreter python3 --name sn1-api -- --wallet.name <WALLET_NAME> --wallet.hotkey <WALLET_HOTKEY> --netuid <NETUID> --neuron.model_id mock --neuron.tasks math --neuron.task_p 1 --neuron.device cpu
86
+ ```
87
+
88
  ## API Usage
89
  At present, the API provides two endpoints: `/chat` (live) and `/echo` (test).
90