linagora / twake-drive

The open-source alternative to Google Drive.
GNU Affero General Public License v3.0
107 stars 21 forks source link

Can't deploy with docker swarm #699

Closed Matheus-h-Campos closed 1 month ago

Matheus-h-Campos commented 1 month ago

I'm using docker swarm with portainer, and I can't deploy it succesfully, the containers keep getting reject status.

version: "3.4"

services:

  tdrive_node:
    image: twakedrive/tdrive-node:latest
    hostname: tdrive_node
    environment:
      - DEV=production
      - SEARCH_DRIVER=mongodb
      - DB_DRIVER=mongodb
      - PUBSUB_TYPE=local
    volumes:
      - ./docker-data/documents/:/storage/
    networks:
      - network_public
    deploy:
      # Define o modo de deploy do container
      mode: replicated
      # Define o numero de replicas do container (sempre 1)
      replicas: 1
      placement:
        constraints:
          - node.role == manager
      resources:
        # Define os limites de recursos do container
        limits:
          # Define o limite de CPU do container
          cpus: "1"
          # Define o limite de memoria do container
          memory: 1024M

  frontend:
    image: twakedrive/tdrive-frontend:latest
    environment:
      - DEV=production
      - NODE_HOST=http://tdrive_node:4000
      # Do not use SSL. Just connect to port 80:
      - SSL_CERTS=off
      #
      # Or generate a self signed certificate, for host `$SSL_SUBJ_CN` (default: `localhost`)
      # unless one exists in `/etc/nginx/ssl/selfsigned.crt`
      #- SSL_CERTS=selfsigned
      #
      #   Tip: To accept invalid certificate on localhost:
      #        - Chrome: enable chrome://flags/#allow-insecure-localhost
      #        - Firefox: about:config > security.enterprise_roots.enabled=true + security.certerrors.mitm.priming.enabled=false
      #
      # If using docker in a virtual or remote machine, create a new hostname in your /etc/hosts pointing to that IP
      # and set `SSL_SUBJ_CN` to that hostname. (Chrome will not accept a self signed certificate for other than localhost.)
      # For ex. with `docker-machine`, get ip with `docker-machine ip <machinename>`,
      # add hosts file entry for docker-machine-default, then browse https://docker-machine-default
      # - SSL_SUBJ_CN=docker-machine-default
      #
      # Debug certificate generation script:
      # - DEBUG=yes
    ports:
      - 8080:80
      - 8443:443
    depends_on:
      - tdrive_node
    volumes:
      - ./docker-data/logs/nginx/:/var/log/nginx
      - ./docker-data/letsencrypt/:/etc/letsencrypt/
      - ./docker-data/drive-preview/:/tdrive-core/web/medias/
      - ./docker-data/uploads/:/tdrive-core/web/upload/
      # If `$SSL_CERTS != off`, mounting certificates here will prevent auto-generating them.
      # This allows you to keep previously generated (or other certificates), but changes to
      # SSL_SUBJ_CN will be ignored then.
      # - ./docker-data/ssl:/etc/nginx/ssl
    networks:
      - network_public
    deploy:
      # Define o modo de deploy do container
      mode: replicated
      # Define o numero de replicas do container (sempre 1)
      replicas: 1
      placement:
        constraints:
          - node.role == manager
      resources:
        # Define os limites de recursos do container
        limits:
          # Define o limite de CPU do container
          cpus: "1"
          # Define o limite de memoria do container
          memory: 1024M

networks:
  network_public:
ericlinagora commented 1 month ago

Hi, haven't tried portainer nor swarm. Can you provide a log/error from the containers with the actual error ? Note that we don't really intend to support other deployment methods than the docker-compose files provided.

ericlinagora commented 1 month ago

Issue dealt with in #707 , support for swarm is not a priority