From 7457865d269774aa82c7508d3915ea70003ec5e1 Mon Sep 17 00:00:00 2001 From: Francesco Picone Date: Fri, 19 Dec 2025 16:25:05 +0100 Subject: [PATCH] Primo caricamento --- .env.example | 15 +++++++++++++++ .gitignore | 5 +++++ README.md | 43 +++++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 25 +++++++++++++++++++++++++ 4 files changed, 88 insertions(+) create mode 100644 .env.example create mode 100644 .gitignore create mode 100644 README.md create mode 100644 docker-compose.yml diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..066c8fe --- /dev/null +++ b/.env.example @@ -0,0 +1,15 @@ +# User and Group ID +PUID=1000 +PGID=1000 + +# Ports +WEB_UI_PORT=8384 +SYNC_PORT=22000 +DISCOVERY_PORT=21027 + +# Volume Paths (modifica questi percorsi secondo le tue esigenze) +# Percorso per la configurazione di Syncthing +CONFIG_PATH=./syncthing/config + +# Percorso per i dati sincronizzati +DATA_PATH=./syncthing/data diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b843380 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +# File di ambiente con dati sensibili +.env + +# Cartelle di Syncthing +syncthing/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..9cc62d3 --- /dev/null +++ b/README.md @@ -0,0 +1,43 @@ +# Syncthing Docker Setup + +Setup Docker per Syncthing con configurazione tramite file .env. + +## Configurazione + +1. Modifica il file `.env` e imposta i percorsi delle cartelle per i dati e la configurazione: + - `DATA_PATH`: cartella fisica dove verranno mappati i file sincronizzati + - `CONFIG_PATH`: cartella per la configurazione di Syncthing + +2. (Opzionale) Modifica `PUID` e `PGID` per corrispondere al tuo utente Linux + +3. (Opzionale) Modifica le porte se necessario + +## Avvio + +```bash +docker-compose up -d +``` + +## Accesso + +Accedi all'interfaccia web di Syncthing all'indirizzo: +``` +http://localhost:8384 +``` + +## Stop + +```bash +docker-compose down +``` + +## Porte utilizzate + +- `8384`: Interfaccia web (HTTP) +- `22000`: Trasferimento file (TCP/UDP) +- `21027`: Local discovery (UDP) + +## Volumi + +- `/var/syncthing/config`: Configurazione di Syncthing +- `/var/syncthing/data`: Dati sincronizzati diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5a7d383 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,25 @@ +version: '3.8' + +services: + syncthing: + image: syncthing/syncthing:latest + container_name: syncthing + hostname: syncthing + environment: + - PUID=${PUID} + - PGID=${PGID} + volumes: + - ${CONFIG_PATH}:/var/syncthing/config + - ${DATA_PATH}:/var/syncthing/data + ports: + - ${WEB_UI_PORT}:8384 # Web UI + - ${SYNC_PORT}:22000/tcp # TCP file transfers + - ${SYNC_PORT}:22000/udp # QUIC file transfers + - ${DISCOVERY_PORT}:21027/udp # Local discovery + restart: unless-stopped + networks: + - syncthing_network + +networks: + syncthing_network: + driver: bridge