Spaces:
Sleeping
Sleeping
Gruhit Patel
commited on
Commit
·
dcb2299
1
Parent(s):
6d1b431
Added HF deployment
Browse files- .github/workflows/hf_deploy.yml +22 -0
- Dockerfile +16 -0
- requirement.txt → requirements.txt +0 -0
.github/workflows/hf_deploy.yml
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: LaunchHFBackend
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
push:
|
| 5 |
+
branches: [main]
|
| 6 |
+
|
| 7 |
+
jobs:
|
| 8 |
+
deploy:
|
| 9 |
+
runs-on: ubuntu-latest
|
| 10 |
+
steps:
|
| 11 |
+
- name: Perform Checkout
|
| 12 |
+
uses: actions/checkout@v2
|
| 13 |
+
|
| 14 |
+
- name: Add Remote
|
| 15 |
+
env:
|
| 16 |
+
HF: ${{ secrets.HF }}
|
| 17 |
+
run: git remote add space https://huggingface.co/spaces/gruhit-patel/deployment_app
|
| 18 |
+
|
| 19 |
+
- name: Push to Space
|
| 20 |
+
env:
|
| 21 |
+
HF: ${{ secrets.HF }}
|
| 22 |
+
run: git push https://gruhit-patel:$HF@huggingface.co/spaces/gruhit-patel/deployment_app main
|
Dockerfile
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.9
|
| 2 |
+
|
| 3 |
+
RUN useradd -m -u 1000 user
|
| 4 |
+
|
| 5 |
+
USER user
|
| 6 |
+
|
| 7 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
| 8 |
+
|
| 9 |
+
WORKDIR /app
|
| 10 |
+
|
| 11 |
+
COPY --chown=user ./requirements.txt requirements.txt
|
| 12 |
+
RUN pip install --no-cache-dir --upgrade -q requirements.txt
|
| 13 |
+
|
| 14 |
+
COPY --chown=user . /app
|
| 15 |
+
|
| 16 |
+
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]
|
requirement.txt → requirements.txt
RENAMED
|
File without changes
|