backdrop-ops / backdrop-docker

Backdrop on Docker
12 stars 9 forks source link

cannot start docker container #48

Open scottcmace opened 3 years ago

scottcmace commented 3 years ago

when I try to start a docker container, using the latest pull from dockerhub for backdrop:latest, being sure to point ENV variables to the proper host, port, db, username, and password, to an existing empty db:

Exception: The configuration directory in settings.php is specified as './files/config_a1614e81308b9e6b86be181ef0914335/active', but this directory is either empty or missing crucial files. Check that the $config_directories variable is correct in settings.php. in _backdrop_bootstrap_configuration() (line 3011 of /var/www/html/core/includes/bootstrap.inc).

psy0rz commented 1 year ago

same here...2 years later

syuza commented 1 year ago

Perhaps there is a mistake in docker-entrypoint.sh.

   export BACKDROP_SETTINGS="{\"databases\":{\"default\":{\"default\":{\"host\":\"database\",\"port\":$BACKDROP_DB_PORT,\"username\": \"$BACKDROP_DB_USER\",\"password\":\"$BACKDROP_DB_PASSWORD\",\"database\":\"$BACKDROP_DB_NAME\",\"driver\":\"$BACKDROP_DB_DRIVER\"}}}}"

I had to change it to the following

   export BACKDROP_SETTINGS="{"databases":{"default":{"host":\"$BACKDROP_DB_HOST",\"port":$BACKDROP_DB_PORT,\"username": \"$BACKDROP_DB_USER\",\"password\":\"$BACKDROP_DB_PASSWORD\",\"database\":\"$BACKDROP_DB_NAME\",\"driver\":\"$BACKDROP_DB_DRIVER\"}}}}"

The string "database" must be changed to $BACKDROP_DB_HOST.

knipknap commented 1 year ago

Same issue... using the following config (for Docker Swarm with Traefik):

version: "3.8"
services:
  db:
    image: mysql:5.7
    networks:
      - abc
    volumes:
      - abc-db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=abc
      - MYSQL_DATABASE=abc
      - MYSQL_USER=abc-web
      - MYSQL_PASSWORD=abc-web

  abc:
    image: backdrop:1.23.1
    networks:
      - abc
    depends_on:
      - db
    environment:
      - BACKDROP_DB_HOST=db
      - BACKDROP_DB_PORT=3306
      - BACKDROP_DB_USER=abc-web
      - BACKDROP_DB_PASSWORD=abc-web
    deploy:
      labels:
        - traefik.enable=true
        - traefik.docker.network=traefik-public
        - traefik.http.routers.abc-https.rule=Host(`abc`)
        - traefik.http.routers.abc-https.entrypoints=https
        - traefik.http.routers.abc-https.tls=true
        - traefik.http.routers.abc-https.tls.certresolver=le
        - traefik.http.services.abc.loadbalancer.server.port=80
polaroi8d commented 1 year ago

Still not working the container.

jungle-guy commented 1 year ago

This does not work with any configuration, it is obviously broken. I see this issue has been open for a long time with no response or changes.

I assume this container project has been abandoned.

Too bad, I thought backdrop might be usable this way, as Drupal is now a hopeless mess, I wanted to move to this fork.

laryn commented 1 year ago

@Wylbur Are you still maintaining this repo? If not maybe we can draft somebody in Zulip to take it on.

Wylbur commented 1 year ago

@laryn Thanks for the heads up, I will dig into this!

jungle-guy commented 1 year ago

@laryn Thanks for the heads up, I will dig into this!

This looks to be completely broken, maybe it should be marked as such so people don't waste time trying to use it.

Here is my general observation after trying to get it to work. I think it has a basic design flaw, it forces you to set your database info, e.g. Database, Host, User and then tries to run an existing site. Unfortunately this is broken and does not work. You should be able to start it up with a normal web bootstrap just like on a VM or physical machine. You would get the normal setup.php and then enter your info. You could then set up a site and save the results so that you can start it up with just docker or docker/compose if you want to move it, etc. This is the simple use case for a simple web site and makes for a really easy config, etc.

I was able to make an image using the PHP image and just some simple compose to configure PHP and load Backdrop. I noticed that installing Backdrop via Git cause the same problems as you have here, it knows it's Docker and messes up. Installing from an archive works just fine. I'm just starting to really learn Docker so I'm still at hacker level so I can't really express the best way forward.

Hope this helps.

freedog96150 commented 1 year ago

@jungle-guy I assume that you have seen the other threads on this topic? https://github.com/backdrop-ops/backdrop-docker/issues/20#issuecomment-609502218 I cannot attest that this problem is completely sovled, but a few custom tweaks to .env and entrypoints and this seems to be working acceptably for dev environments. I have yet to take any of this to production at this time, but I do run many other websites on docker in production.

bonjour-py commented 1 week ago

same here...2 years later

same here another 2 years later

bonjour-py commented 1 week ago

As a temporary solution. to connect other mysql server

set docker CMD

tag: apache sh -c " sed -i '42s@database@$BACKDROP_DB_HOST@2' /entrypoint.sh && /entrypoint.sh apache2-foreground "

tag: fpm sh -c " sed -i '42s@database@$BACKDROP_DB_HOST@2' /entrypoint.sh && /entrypoint.sh php-fpm "

by the way: docs says ‘Backdrop may be connected to any type of database so long as it is supported by a PHP PDO Driver (see the list of available drivers at PHP.net).’ https://docs.backdropcms.org/documentation/database-configuration but actually only mysql