Skip to content

Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.

chore(docker): add docker-compose files

johaven2ba7e8fcd5db
diff --git a/README.md b/README.md
index 953ab2a5..e403fe8f 100644
--- a/README.md
+++ b/README.md
@@ -60,9 +60,9 @@ Sync-in fits seamlessly into any environment — from small teams to large enter
- 🌍 **Official website**: [https://sync-in.com](https://sync-in.com)
- 📖 **Documentation**: [https://sync-in.com/docs](https://sync-in.com/docs)
-- 🗄️ **Server** - Full-stack server : [https://github.com/Sync-in/server](https://github.com/Sync-in/server)
+- 🗄️ **Server** : [https://github.com/Sync-in/server](https://github.com/Sync-in/server)
- 💻 **Desktop & CLI** - Cross-platform desktop app and command-line interface : [https://github.com/Sync-in/desktop](https://github.com/Sync-in/desktop)
-- 🐳 **Docker** - Docker images and deployment configuration : [https://github.com/Sync-in/docker](https://github.com/Sync-in/docker)
+- 🐳 **Docker** - Setup & Deployment Guide : [https://sync-in.com/docs/setup-guide/docker](https://sync-in.com/docs/setup-guide/docker)
---
@@ -75,8 +75,8 @@ If you find it useful, you can:
- 🐛 Report issues and suggest improvements
- 🤝 Contribute code, translations, or documentation
- 💬 Join the community on :
+ - [GitHub Discussions](https://github.com/orgs/Sync-in/discussions)
- [Discord](https://discord.gg/qhJyzwaymT)
- - [Stack Overflow](https://stackoverflow.com/questions/tagged/sync-in)
- 💖 [Support the project !](https://sync-in.com/support)
---
diff --git a/docker/config/nginx/docker-compose.nginx.yaml b/docker/config/nginx/docker-compose.nginx.yaml
new file mode 100644
index 00000000..4bba9e78
--- /dev/null
+++ b/docker/config/nginx/docker-compose.nginx.yaml
@@ -0,0 +1,19 @@
+services:
+ nginx:
+ image: nginx:alpine
+ container_name: nginx
+ restart: always
+ volumes:
+ - ./nginx.conf:/etc/nginx/conf.d/default.conf
+ ports:
+ - "80:80"
+ logging:
+ driver: json-file
+ options:
+ max-size: "25m"
+ max-file: "5"
+ depends_on:
+ - sync_in
+ networks:
+ - sync_in_network
+
diff --git a/docker/config/nginx/nginx.conf b/docker/config/nginx/nginx.conf
new file mode 100644
index 00000000..750df00a
--- /dev/null
+++ b/docker/config/nginx/nginx.conf
@@ -0,0 +1,99 @@
+# SYNC-IN NGINX TEMPLATE
+
+map $request_uri $xfp {
+ # This header must be null on webdav uri
+ # It causes authentication problems with Microsoft-WebDAV-MiniRedir (Windows)
+ ~^/webdav(?:/.*)? "";
+ default $scheme;
+}
+
+
+map $http_upgrade $connection_upgrade {
+ default upgrade;
+ '' close;
+}
+
+upstream sync_in_server {
+ server sync_in:8080;
+ keepalive 32;
+}
+
+server {
+ listen 80;
+ # listen 443 ssl;
+ # server_name domain.com www.domain.com;
+ # ssl_certificate /etc/ssl/certs/fullchain.pem;
+ # ssl_certificate_key /etc/ssl/certs/privkey.pem;
+ # ssl_protocols TLSv1.2 TLSv1.3;
+ # ssl_session_cache shared:SSL:10m;
+ # ssl_session_timeout 1h;
+ # ssl_prefer_server_ciphers on;
+ # ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305';
+ # ssl_ecdh_curve X25519:prime256v1;
+
+ # General settings
+ charset UTF-8;
+ server_tokens off;
+ access_log off;
+ include mime.types;
+
+ # Optimized file sending
+ sendfile on;
+ tcp_nodelay on;
+ tcp_nopush on;
+
+ # Buffering for requests proxied to Node
+ proxy_http_version 1.1;
+ chunked_transfer_encoding on;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Host $host;
+ proxy_set_header X-Forwarded-Proto $xfp;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection $connection_upgrade;
+ proxy_cache_bypass $http_upgrade;
+ proxy_redirect off;
+
+ # Proxy buffering settings
+ proxy_buffering off; # nginx -> node
+ proxy_buffers 8 512k;
+ proxy_buffer_size 512k; # node highWaterMark
+
+ # Generous timeouts for long transfers
+ proxy_read_timeout 900s;
+ proxy_send_timeout 900s;
+ keepalive_timeout 180 90s;
+
+ # Clients settings
+ proxy_request_buffering off; # client -> nginx
+ large_client_header_buffers 4 16k;
+ client_max_body_size 0;
+ client_body_buffer_size 25M;
+
+ location / {
+ proxy_pass http://sync_in_server;
+ }
+
+ location ^~ /onlyoffice/ {
+ proxy_pass http://onlyoffice:80/;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Host $host/onlyoffice;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_set_header Host $host;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection $connection_upgrade;
+ proxy_no_cache 1;
+ proxy_cache_bypass 1;
+ }
+
+ location ~* .(ico|jpg|png|gif|jpeg|swf|woff|svg)$ {
+ # nginx always use the most accurate rule in its internal routing policies
+ proxy_pass http://sync_in_server;
+ gzip_static on;
+ gzip_comp_level 5;
+ expires 1d;
+ add_header Cache-Control public;
+ }
+}
\ No newline at end of file
diff --git a/docker/config/onlyoffice/docker-compose.onlyoffice.yaml b/docker/config/onlyoffice/docker-compose.onlyoffice.yaml
new file mode 100644
index 00000000..3a3ba3af
--- /dev/null
+++ b/docker/config/onlyoffice/docker-compose.onlyoffice.yaml
@@ -0,0 +1,16 @@
+services:
+ onlyoffice:
+ image: onlyoffice/documentserver:9.0
+ container_name: onlyoffice
+ restart: always
+ environment:
+ - JWT_SECRET=onlyOfficeSecret
+ - JWT_IN_BODY=true
+ - USE_UNAUTHORIZED_STORAGE=true
+ logging:
+ driver: json-file
+ options:
+ max-size: "25m"
+ max-file: "5"
+ networks:
+ - sync_in_network
\ No newline at end of file
diff --git a/docker/config/sync-in-desktop-releases/docker-compose.sync-in-desktop-releases.yaml b/docker/config/sync-in-desktop-releases/docker-compose.sync-in-desktop-releases.yaml
new file mode 100644
index 00000000..1f76cb55
--- /dev/null
+++ b/docker/config/sync-in-desktop-releases/docker-compose.sync-in-desktop-releases.yaml
@@ -0,0 +1,15 @@
+services:
+ sync_in_desktop_releases:
+ profiles: [ "releases" ]
+ image: syncin/desktop-releases:latest
+ container_name: sync-in-desktop-releases
+ user: "${PUID:-8888}:${PGID:-8888}"
+ volumes:
+ - desktop_releases:/releases:ro
+ restart: "no"
+ entrypoint: [ "/bin/true" ]
+ networks:
+ - sync_in_network
+
+volumes:
+ desktop_releases:
\ No newline at end of file
diff --git a/docker/config/sync-in-desktop-releases/update.sh b/docker/config/sync-in-desktop-releases/update.sh
new file mode 100755
index 00000000..9eb35379
--- /dev/null
+++ b/docker/config/sync-in-desktop-releases/update.sh
@@ -0,0 +1,5 @@
+docker compose pull sync_in_desktop_releases
+docker compose down sync_in
+docker volume rm sync-in_desktop_releases
+docker compose run --rm sync_in_desktop_releases
+docker compose up sync_in -d
\ No newline at end of file
diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml
new file mode 100644
index 00000000..ba51610d
--- /dev/null
+++ b/docker/docker-compose.yaml
@@ -0,0 +1,54 @@
+#include:
+# - ./config/nginx/docker-compose.nginx.yaml
+# - ./config/onlyoffice/docker-compose.onlyoffice.yaml
+# - ./config/sync-in-desktop-releases/docker-compose.sync-in-desktop-releases.yaml
+
+name: sync-in
+services:
+ sync_in:
+ image: syncin/server:1
+ container_name: sync-in
+ restart: always
+ environment:
+ - INIT_ADMIN
+ - INIT_ADMIN_PASSWORD
+ - INIT_ADMIN_LOGIN
+ - PUID=${PUID:-8888}
+ - PGID=${PGID:-8888}
+ ports:
+ - "8080:8080"
+ volumes:
+ - ./environment.yaml:/app/environment/environment.yaml
+ - data:/app/data
+ - desktop_releases:/app/static/releases:ro
+ depends_on:
+ - mariadb
+ logging:
+ driver: json-file
+ options:
+ max-size: "25m"
+ max-file: "5"
+ networks:
+ - sync_in_network
+
+ mariadb:
+ image: mariadb:11
+ container_name: mariadb
+ restart: always
+ command: --innodb_ft_cache_size=16000000 --max-allowed-packet=1G
+ environment:
+ MYSQL_ROOT_PASSWORD: MySQLRootPassword
+ MYSQL_DATABASE: sync_in
+ volumes:
+ - mariadb_data:/var/lib/mysql
+ networks:
+ - sync_in_network
+
+networks:
+ sync_in_network:
+ driver: bridge
+
+volumes:
+ data:
+ mariadb_data:
+ desktop_releases:
diff --git a/docker/environment.yaml b/docker/environment.yaml
new file mode 100755
index 00000000..63793b00
--- /dev/null
+++ b/docker/environment.yaml
@@ -0,0 +1,17 @@
+server:
+ # prevent displaying Docker internal IP addresses
+ trustProxy: true
+mysql:
+ url: mysql://root:MySQLRootPassword@mariadb:3306/sync_in
+auth:
+ token:
+ access:
+ secret: changeAccessWithStrongSecret
+ refresh:
+ secret: changeRefreshWithStrongSecret
+applications:
+ files:
+ dataPath: /app/data
+ onlyoffice:
+ enabled: false
+ secret: onlyOfficeSecret
\ No newline at end of file