Spaces:
Sleeping
Sleeping
Commit
Β·
619c141
1
Parent(s):
5111128
add: huggingface docker
Browse files- README.md +0 -1
- deploy-hf.sh +0 -37
- docker-compose.hf.yml +0 -44
- docker-compose.yml +2 -2
README.md
CHANGED
|
@@ -5,7 +5,6 @@ colorFrom: gray
|
|
| 5 |
colorTo: green
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
-
app_build_command: bash ./deploy-hf.sh
|
| 9 |
---
|
| 10 |
|
| 11 |
# Quotation Generator
|
|
|
|
| 5 |
colorTo: green
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
# Quotation Generator
|
deploy-hf.sh
DELETED
|
@@ -1,37 +0,0 @@
|
|
| 1 |
-
#!/bin/bash
|
| 2 |
-
|
| 3 |
-
# Build and deploy script for invoice generator on Hugging Face Spaces
|
| 4 |
-
|
| 5 |
-
set -e
|
| 6 |
-
|
| 7 |
-
echo "π€ Starting Hugging Face Spaces deployment process..."
|
| 8 |
-
|
| 9 |
-
# Stop existing services
|
| 10 |
-
echo "π Stopping existing services..."
|
| 11 |
-
docker-compose -f docker-compose.hf.yml down 2>/dev/null || true
|
| 12 |
-
|
| 13 |
-
# Build and start the Hugging Face Spaces service
|
| 14 |
-
echo "π¦ Building and starting services for HF Spaces..."
|
| 15 |
-
docker-compose -f docker-compose.hf.yml up --build -d
|
| 16 |
-
|
| 17 |
-
# Show status
|
| 18 |
-
echo "π Service status:"
|
| 19 |
-
docker-compose -f docker-compose.hf.yml ps
|
| 20 |
-
|
| 21 |
-
echo "β
Hugging Face Spaces deployment completed successfully!"
|
| 22 |
-
echo "π Application is available at: http://localhost:7860"
|
| 23 |
-
echo "π€ Ready to deploy to Hugging Face Spaces!"
|
| 24 |
-
|
| 25 |
-
# Optional: Show logs
|
| 26 |
-
echo "π Recent logs:"
|
| 27 |
-
docker-compose -f docker-compose.hf.yml logs --tail=20 invoice-generator
|
| 28 |
-
|
| 29 |
-
echo ""
|
| 30 |
-
echo "π Next steps for Hugging Face Spaces:"
|
| 31 |
-
echo "1. Create a new Space on Hugging Face"
|
| 32 |
-
echo "2. Upload these files to your Space:"
|
| 33 |
-
echo " - Dockerfile.hf (rename to Dockerfile)"
|
| 34 |
-
echo " - nginx.hf.conf"
|
| 35 |
-
echo " - All your source files (package.json, src/, etc.)"
|
| 36 |
-
echo "3. Set Space SDK to 'docker'"
|
| 37 |
-
echo "4. Your app will be available on port 7860"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
docker-compose.hf.yml
DELETED
|
@@ -1,44 +0,0 @@
|
|
| 1 |
-
services:
|
| 2 |
-
invoice-generator:
|
| 3 |
-
build:
|
| 4 |
-
context: .
|
| 5 |
-
dockerfile: Dockerfile.hf
|
| 6 |
-
target: production
|
| 7 |
-
ports:
|
| 8 |
-
- "7860:7860"
|
| 9 |
-
restart: unless-stopped
|
| 10 |
-
container_name: invoice-generator-hf
|
| 11 |
-
environment:
|
| 12 |
-
- NODE_ENV=production
|
| 13 |
-
- PORT=7860
|
| 14 |
-
labels:
|
| 15 |
-
- "com.docker.compose.service=invoice-generator"
|
| 16 |
-
- "com.docker.compose.environment=huggingface"
|
| 17 |
-
logging:
|
| 18 |
-
driver: "json-file"
|
| 19 |
-
options:
|
| 20 |
-
max-size: "10m"
|
| 21 |
-
max-file: "3"
|
| 22 |
-
healthcheck:
|
| 23 |
-
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:7860/"]
|
| 24 |
-
interval: 30s
|
| 25 |
-
timeout: 10s
|
| 26 |
-
retries: 3
|
| 27 |
-
start_period: 40s
|
| 28 |
-
deploy:
|
| 29 |
-
resources:
|
| 30 |
-
limits:
|
| 31 |
-
memory: 512M
|
| 32 |
-
cpus: "0.5"
|
| 33 |
-
reservations:
|
| 34 |
-
memory: 256M
|
| 35 |
-
cpus: "0.25"
|
| 36 |
-
security_opt:
|
| 37 |
-
- no-new-privileges:true
|
| 38 |
-
read_only: true
|
| 39 |
-
tmpfs:
|
| 40 |
-
- /tmp
|
| 41 |
-
- /var/cache/nginx
|
| 42 |
-
- /var/run
|
| 43 |
-
- /run
|
| 44 |
-
- /var/log/nginx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
docker-compose.yml
CHANGED
|
@@ -4,7 +4,7 @@ services:
|
|
| 4 |
invoice-generator:
|
| 5 |
build:
|
| 6 |
context: .
|
| 7 |
-
dockerfile: Dockerfile
|
| 8 |
target: production
|
| 9 |
ports:
|
| 10 |
- "8080:80"
|
|
@@ -15,7 +15,7 @@ services:
|
|
| 15 |
invoice-generator-dev:
|
| 16 |
build:
|
| 17 |
context: .
|
| 18 |
-
dockerfile: Dockerfile
|
| 19 |
target: builder
|
| 20 |
ports:
|
| 21 |
- "1234:1234"
|
|
|
|
| 4 |
invoice-generator:
|
| 5 |
build:
|
| 6 |
context: .
|
| 7 |
+
dockerfile: Dockerfile.prod
|
| 8 |
target: production
|
| 9 |
ports:
|
| 10 |
- "8080:80"
|
|
|
|
| 15 |
invoice-generator-dev:
|
| 16 |
build:
|
| 17 |
context: .
|
| 18 |
+
dockerfile: Dockerfile.prod
|
| 19 |
target: builder
|
| 20 |
ports:
|
| 21 |
- "1234:1234"
|