• 1 Post
  • 18 Comments
Joined 1 year ago
cake
Cake day: June 10th, 2023

help-circle






  • OK! So here we go.

    I already use Caddy on my server because of other services I have running so I was afraid it could conflict with the caddy container in the docker-compose you provide, so I disabled caddy service just for testing and afterwards I could try to figure how to make it work alongside my current configuration. But for some reason I can’t get my domain to connect to the instance.

    So I decided to try different and do not install the caddy container and use the one I have running natively. So I just coppied the Caddyfile content that is generated by the deploy.sh and replaced the env variable with my domain name (just to make sure it would work).

    I changed the docker-compose.yml to this:

    version: "3.9"
    x-logging:
      &default-logging
      options:
        max-size: '500m'
      driver: json-file
    
    services:
    
      lemmy:
        image: dessalines/lemmy:0.17.4
        environment:
          - RUST_LOG="warn,lemmy_server=info,lemmy_api=info,lemmy_api_common=info,lemmy_api_crud=info,lemmy_apub=info,lemmy_db_schema=info,lemmy_db_views=info,lemmy_db_views_actor=info,lemmy_db_views_moderator=info,lemmy_routes=info,lemmy_utils=info,lemmy_websocket=info"
        volumes:
          - ./lemmy.hjson:/config/config.hjson
        depends_on:
          - postgres
          - pictrs
        networks:
          - lemmyinternal
          - lemmybridge
        ports:
          - 8536:8536
        restart: always
        logging: *default-logging
    
      lemmy-ui:
        image: dessalines/lemmy-ui:0.17.4
        environment:
          - LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy:8536
          - LEMMY_UI_LEMMY_EXTERNAL_HOST=localhost:1236
          - LEMMY_HTTPS=true
        depends_on:
          - lemmy
        networks:
          - lemmyinternal
        ports:
        #Always keep em guessing
          - 1236:1234
        restart: always
        logging: *default-logging
    
      pictrs:
        image: asonix/pictrs:0.3.1
        user: 991:991
        env_file:
          - ./pictrs.env
        volumes:
          - pictrs_data:/mnt
        networks:
          - lemmyinternal
          - lemmybridge
        restart: always
        logging: *default-logging
    
      postgres:
        image: postgres:15-alpine
        environment:
          - POSTGRES_USER=lemmy
          - POSTGRES_DB=lemmy
        env_file:
          - ./postgres.env
        volumes:
          - postgres_data:/var/lib/postgresql/data
        networks:
          - lemmyinternal
        ports:
          - 5432:5432
        restart: always
        logging: *default-logging
    
    networks:
      lemmyexternalproxy:
      lemmybridge:
      lemmyinternal:
        driver: bridge
        internal: true
    

    Placed all the .env in the same folder of the docker-compose.yml and placed the lemmy.hjson in this same folder too.

    {
      setup: {
        admin_username: "lemmy"
        admin_password: "sjhdakjhsdjhasdkjashdjkahs"
        site_name: "Lemmy"
      }
    
      hostname: "lemmy.eco.br"
      bind: "0.0.0.0"
      port: 8536
      tls_enabled: true
    
      pictrs: {
        url: "http://pictrs:8080/"
        api_key: "dkslahlsdjhasjdçlajsçdaskj"
      }
    
      database: {
        user: "lemmy"
        password: "jahdskjhadjsappdsiadopisap"
        host: "postgres"
        port: 5432
        database: "lemmy"
        pool_size: 5
      }
    
    }
    

    runned the docker-compose up -d and everything went OK, no errors in the terminal. but still my domain don’t connect.

    I have disabled cloudflare proxy and cache but nothing helped :(