Added docker functionality.
This commit is contained in:
33
README.md
33
README.md
@@ -56,3 +56,36 @@ This will reset and recalculate all `nsfw` flags so that the new filters work co
|
||||
- Python 3.x
|
||||
- Standard Python libraries (http.server, sqlite3, etc.)
|
||||
- Web browser with JavaScript enabled
|
||||
|
||||
## Docker
|
||||
|
||||
If you have Docker installed you can build and run the application in an isolated container:
|
||||
|
||||
```bash
|
||||
# Build image (only once)
|
||||
docker build -t swiper-app .
|
||||
|
||||
# Run the container on port 8888
|
||||
docker run --rm -p 8888:8888 swiper-app
|
||||
```
|
||||
|
||||
Then open [http://localhost:8888](http://localhost:8888) in your browser.
|
||||
|
||||
The Dockerfile uses a minimal Python 3.11 image, installs the Python dependencies from `requirements.txt`, exposes port 8888 and starts the app with `python server.py`.
|
||||
|
||||
### Docker Compose
|
||||
|
||||
A `docker-compose.yml` file is included so you can run the container with your image folders mounted automatically.
|
||||
|
||||
```bash
|
||||
# Build image (first time or when code changes)
|
||||
docker compose up --build
|
||||
```
|
||||
|
||||
This will:
|
||||
|
||||
- Publish port **8888** on your host → container.
|
||||
- Mount the portrait and landscape image folders (update paths in `docker-compose.yml` as needed) read-only into `/media/Portrait` and `/media/Landscape` inside the container.
|
||||
- Set `IMAGE_DIRS=/media/Portrait:/media/Landscape` so the server finds the images.
|
||||
|
||||
Adjust ports, folders or environment variables by editing `docker-compose.yml`. Remember to rebuild (`docker compose up --build`) after changes.
|
||||
|
||||
Reference in New Issue
Block a user