Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Add Docker configuration for Hugging Face Spaces
Browse files- Dockerfile with multi-stage build (node + nginx)
- Serves on port 7860 for HF Spaces compatibility
- README with HF Spaces metadata and deployment instructions
- .dockerignore to optimize build context
- .dockerignore +11 -0
- Dockerfile +35 -0
- README.md +42 -0
.dockerignore
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
node_modules
|
| 2 |
+
dist
|
| 3 |
+
.git
|
| 4 |
+
.gitignore
|
| 5 |
+
.env
|
| 6 |
+
.env.*
|
| 7 |
+
!.env.example
|
| 8 |
+
.DS_Store
|
| 9 |
+
*.log
|
| 10 |
+
.claude
|
| 11 |
+
.idea
|
Dockerfile
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Build stage
|
| 2 |
+
FROM node:20-alpine AS builder
|
| 3 |
+
|
| 4 |
+
WORKDIR /app
|
| 5 |
+
|
| 6 |
+
# Mapbox token passed as build arg (set in HF Spaces secrets)
|
| 7 |
+
ARG VITE_MAPBOX_TOKEN
|
| 8 |
+
ENV VITE_MAPBOX_TOKEN=$VITE_MAPBOX_TOKEN
|
| 9 |
+
|
| 10 |
+
COPY package*.json ./
|
| 11 |
+
RUN npm ci
|
| 12 |
+
|
| 13 |
+
COPY . .
|
| 14 |
+
RUN npm run build
|
| 15 |
+
|
| 16 |
+
# Production stage
|
| 17 |
+
FROM nginx:alpine
|
| 18 |
+
|
| 19 |
+
# Copy built files
|
| 20 |
+
COPY --from=builder /app/dist /usr/share/nginx/html
|
| 21 |
+
|
| 22 |
+
# Custom nginx config for HF Spaces (port 7860)
|
| 23 |
+
RUN echo 'server { \
|
| 24 |
+
listen 7860; \
|
| 25 |
+
server_name localhost; \
|
| 26 |
+
location / { \
|
| 27 |
+
root /usr/share/nginx/html; \
|
| 28 |
+
index index.html; \
|
| 29 |
+
try_files $uri $uri/ /index.html; \
|
| 30 |
+
} \
|
| 31 |
+
}' > /etc/nginx/conf.d/default.conf
|
| 32 |
+
|
| 33 |
+
EXPOSE 7860
|
| 34 |
+
|
| 35 |
+
CMD ["nginx", "-g", "daemon off;"]
|
README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Patrouille de France Tracker
|
| 3 |
+
emoji: ✈️
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: red
|
| 6 |
+
sdk: docker
|
| 7 |
+
pinned: false
|
| 8 |
+
license: mit
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# Patrouille de France Airshow Tracker
|
| 12 |
+
|
| 13 |
+
Interactive map tracking Patrouille de France airshows with animated flight paths.
|
| 14 |
+
|
| 15 |
+
## Features
|
| 16 |
+
|
| 17 |
+
- Interactive Mapbox map centered on France
|
| 18 |
+
- Timeline of 2025-2026 airshows
|
| 19 |
+
- Animated flight paths with contrail effects
|
| 20 |
+
- Alpha Jet marker following the path
|
| 21 |
+
- Countdown to next event
|
| 22 |
+
|
| 23 |
+
## Local Development
|
| 24 |
+
|
| 25 |
+
```bash
|
| 26 |
+
npm install
|
| 27 |
+
npm run dev
|
| 28 |
+
```
|
| 29 |
+
|
| 30 |
+
## Environment Variables
|
| 31 |
+
|
| 32 |
+
Create a `.env` file with your Mapbox token:
|
| 33 |
+
|
| 34 |
+
```
|
| 35 |
+
VITE_MAPBOX_TOKEN=your_token_here
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
## Hugging Face Spaces Deployment
|
| 39 |
+
|
| 40 |
+
1. Create a new Space with Docker SDK
|
| 41 |
+
2. Add `VITE_MAPBOX_TOKEN` as a secret in Settings → Variables and secrets
|
| 42 |
+
3. Push the code to the Space repository
|