feat: add Docker configuration for containerized deployment

This commit is contained in:
Andrew 2026-03-15 15:02:08 +07:00
parent f29dcad16e
commit 80fe7a99f0
4 changed files with 173 additions and 0 deletions

View file

@ -8,6 +8,9 @@ Python project for land cover classification using GIS data (GeoTIFF + Shapefile
gis-classification/
├── main.py # Main script with parameters
├── requirements.txt # Dependencies
├── Dockerfile # Docker image configuration
├── docker-compose.yml # Docker Compose configuration
├── .dockerignore # Docker ignore rules
├── data/ # Input data folder
├── output/ # Classification results
├── static/ # Web frontend
@ -33,6 +36,44 @@ Or with uv:
uv pip install -r requirements.txt
```
### Docker Deployment
**Build and run with Docker Compose:**
```bash
docker-compose up --build
```
**Or run with Docker directly:**
```bash
docker build -t gis-classification .
docker run -p 8000:8000 -v $(pwd)/data:/app/data -v $(pwd)/output:/app/output gis-classification
```
Then open http://localhost:8000 in your browser.
**Production with Nginx (optional):**
1. Uncomment the nginx section in `docker-compose.yml`
2. Create `nginx.conf` (see example below)
3. Run `docker-compose up -d`
Example `nginx.conf`:
```nginx
events { worker_connections 1024; }
http {
server {
listen 80;
location / {
proxy_pass http://gis-classification:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
}
```
## Usage
### CLI Mode