注意:tuetenk0pp/sharelatex-full:3.5.6 这个镜像非常的大,有12G,使用的时候最好先docker pull下来,然后再运行

# This is meant for use in development, use the method described in README.md for deployment instead.
version: '2.2'
services:
    sharelatex:
        restart: always
        image: tuetenk0pp/sharelatex-full:3.5.6
        container_name: sharelatex
        depends_on:
            mongo:
                condition: service_healthy
            redis:
                condition: service_started
        ports:
            - 26:80 # http://localhost:26/launchpad
        links:
            - mongo
            - redis
        volumes:
            - ./sharelatex_data:/var/lib/sharelatex
        environment:

            SHARELATEX_APP_NAME: Overleaf Community Edition

            SHARELATEX_MONGO_URL: mongodb://mongo/sharelatex

            # Same property, unfortunately with different names in
            # different locations
            SHARELATEX_REDIS_HOST: redis
            REDIS_HOST: redis
            # 网站url
            SHARELATEX_SITE_URL: http://localhost:26
            
            ENABLED_LINKED_FILE_TYPES: 'project_file,project_output_file'

            # Enables Thumbnail generation using ImageMagick
            ENABLE_CONVERSIONS: 'true'

            # Disables email confirmation requirement
            EMAIL_CONFIRMATION_DISABLED: 'true'

            # temporary fix for LuaLaTex compiles
            # see https://github.com/overleaf/overleaf/issues/695
            TEXMFVAR: /var/lib/sharelatex/tmp/texmf-var

    mongo:
        restart: always
        image: mongo:4.4
        container_name: mongo
        expose:
            - 27017
        volumes:
            - ./mongo_data:/data/db
        healthcheck:
            test: echo 'db.stats().ok' | mongo localhost:27017/test --quiet
            interval: 10s
            timeout: 10s
            retries: 5
        # https://github.com/overleaf/overleaf/wiki/Release-Notes--4.x.x#manually-setting-up-mongodb-as-a-replica-set

    redis:
        restart: always
        image: redis:5
        container_name: redis
        expose:
            - 6379
        volumes:
            - ./redis_data:/data