Spaces:
Sleeping
Sleeping
Upload with huggingface_hub
Browse files- Dockerfile +20 -0
- app.py +12 -0
- requirements.txt +1 -0
- workcell.yaml +10 -0
Dockerfile
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
2 |
+
# you will also find guides on how best to write your Dockerfile
|
3 |
+
|
4 |
+
FROM python:3.8
|
5 |
+
|
6 |
+
# Set up a new user named "user" with user ID 1000
|
7 |
+
RUN useradd -m -u 1000 user
|
8 |
+
# Switch to the "user" user
|
9 |
+
USER user
|
10 |
+
# Set home to the user's home directory
|
11 |
+
ENV HOME=/home/user \
|
12 |
+
PATH=/home/user/.local/bin:$PATH
|
13 |
+
# Set the working directory to the user's home directory
|
14 |
+
WORKDIR $HOME/app
|
15 |
+
|
16 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
17 |
+
COPY --chown=user . $HOME/app
|
18 |
+
RUN pip install --no-cache-dir --upgrade -r $HOME/app/requirements.txt
|
19 |
+
|
20 |
+
CMD ["workcell", "serve", "--config", "workcell.yaml", "--host", "0.0.0.0", "--port", "7860"]
|
app.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from pydantic import BaseModel
|
2 |
+
|
3 |
+
|
4 |
+
class Input(BaseModel):
|
5 |
+
message: str
|
6 |
+
|
7 |
+
class Output(BaseModel):
|
8 |
+
message: str
|
9 |
+
|
10 |
+
def hello_workcell(input: Input) -> Output:
|
11 |
+
"""Returns the `message` of the input data."""
|
12 |
+
return Output(message=input.message)
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
workcell
|
workcell.yaml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: hello_workcell
|
2 |
+
provider:
|
3 |
+
name: huggingface
|
4 |
+
repository: weanalyze/hello_workcell
|
5 |
+
branch: main
|
6 |
+
version: latest
|
7 |
+
runtime: python3.8
|
8 |
+
entrypoint: app:hello_workcell
|
9 |
+
tags: {}
|
10 |
+
envs: {}
|