Skip to content

Twake Drive

This is the Docker Compose configuration for Twake Drive.

yaml
services:
  mongo:
    container_name: mongo
    image: mongo
    volumes:
      - mongo-data:/data/db
    networks:
      - tdrive_network

  tdrive_node:
    image: twakedrive/tdrive-node
    hostname: tdrive_node
    environment:
      - DEV=production
      - SEARCH_DRIVER=mongodb
      - DB_DRIVER=mongodb
      - PUBSUB_TYPE=local
    volumes:
      - ./docker-data/documents/:/storage/
    depends_on:
      - mongo
    links:
      - mongo
    networks:
      - tdrive_network

  frontend:
    image: twakedrive/tdrive-frontend
    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=off
      #
      #   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
      - 4433: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:
      - tdrive_network

networks:
  tdrive_network:
    driver: bridge

volumes:
  mongo-data: