Giter Club home page Giter Club logo

Comments (5)

victor-rds avatar victor-rds commented on July 26, 2024

For the wrong permissions there are two solutions, as explained on #39 this image don't use PUID or GUID values, they are detected at runtime, and for security reasons the container won't run as root anymore.

First you can set the runtime user using docker run -u userid:groupid .... or in your compose file with user: "userid:groupid"
Second just change the owner of ./etebase/data to 373 the default user of the image.

from docker-etebase.

victor-rds avatar victor-rds commented on July 26, 2024

Now for the docker-composer with postgres there is some error in your file:

  1. The DATABASE_HOST: postgres isn't the same as the service below

  2. Use of secrets without appeding "_FILE", nor declaring or mounting them.

environment:
  SUPER_PASS_FILE: /run/secrets/db-password
secrets
  - db-password
  1. The database and the etebase sever container don't share a network, meaning they are unreachable to each other

I will build an example and try to reproduce this issue. in the meantime try to make this changes and test

from docker-etebase.

victor-rds avatar victor-rds commented on July 26, 2024

This worked docker-compose.yml for me:

version: "3"

# Network mock-up to simulate your setup
networks:
  default:
    internal: true
  t2_proxy:

services:
  # Traefik mock-up to simulate your setup
  traefik:
    image: "traefik:2.3"
    container_name: "traefik"
    networks:
      - t2_proxy
    command:
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.https.address=:80"
    ports:
      - "80:80"
      - "8080:8080"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    restart: always

  etebase:
    container_name: etebase
    image: victorrds/etebase
    restart: always
    networks:
      - t2_proxy
      # Add database network
      - default
    volumes:
      - ./etebase/data:/data
      # Simulating Swarm Secrets
      - ./etebase/secrets:/run/secrets:ro
    environment:
      SERVER: http-socket
      SUPER_USER: ${ETEBASE_ADMIN_USER}
      # Fix variable with secrets syntax
      SUPER_PASS_FILE: /run/secrets/db-password
      DB_ENGINE: postgres
      DATABASE_NAME: ${DB}
      DATABASE_USER: ${DB_USER}
      DATABASE_PASSWORD: ${DB_PASSWORD}
      # Fix the correct Database Host
      DATABASE_HOST: etebase-db
    labels:
      - "traefik.enable=true"
      ## HTTP Routers
      - "traefik.http.routers.etebase-rtr.entrypoints=https"
      - "traefik.http.routers.etebase-rtr.rule=Host(`etebase.$DOMAINNAME`)"
      # Disable TLS for this test
      #- "traefik.http.routers.etebase-rtr.tls=true" 
      #- "traefik.http.routers.etebase-rtr.tls.certresolver=default" 
      ## HTTP Services
      - "traefik.http.routers.etebase-rtr.service=etebase-svc"
      - "traefik.http.services.etebase-svc.loadbalancer.server.port=3735"

  etebase-db:
    image: postgres:13
    container_name: etebase-db
    restart: always
    volumes:
      -./etebase/db:/var/lib/postgresql/data
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USER}
      POSTGRES_DB: ${DB}
      POSTGRES_HOST_AUTH_METHOD: trust
    healthcheck:
      interval: 5s
      timeout: 3s
      retries: 5
    labels:
      - "traefik.enable=false"

Be aware that this error:

2020-11-13T09:12:41+00:00 [ERROR] [Entrypoint]: 
---------------------------------------------------------------------
This database schema is not compatible with Etebase (EteSync 2.0)
To avoid any data damage the container will now fail to start
Please save your data follow this instructions instructions:
https://github.com/etesync/server#updating-from-version-050-or-before
---------------------------------------------------------------------

Will also happens if the postgres is not ready, because of the restart: always etebase will restart and try until postgres becomes available

from docker-etebase.

worldofgeese avatar worldofgeese commented on July 26, 2024

Thanks for pointing out my mistakes :-) I can confirm your changes work.

from docker-etebase.

thgoebel avatar thgoebel commented on July 26, 2024

I didn't try this here, but I think you could use depends_on: etebase-db for the etebase service to tell compose to only start it when etebase-db is ready.

from docker-etebase.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.