Question

Connecting Adminer to sqlite3 DB in docker-compose-yml

I have a Directus 10.6 instance running here on DO, setup via docker-compose.yml and using a sqlite3 DB. Now I would like to use Adminer to administer the DB, but unfortunately I cannot get it to work. This is my docker-compose.yml:

version: '3'
services:
  cache_jvds:
    image: redis:7
    networks:
      - jvds
    env_file:
      - .env

  directus_jvds:
    image: directus/directus:10.6.1
    ports:
      - 8056:8055 # external:internal
    volumes:
      - ./uploads:/directus/uploads
      - ./database:/directus/database
      - ./extensions:/directus/extensions
    networks:
      - jvds
    depends_on:
      - cache_jvds
    env_file:
      - .env

  adminer_jvds:
    image: 'adminer:standalone'
    ports:
      - 8080:8080
    depends_on:
      - directus_jvds
    networks:
      - jvds
    env_file:
      - .env

networks:
  jvds:
    name: jvds
    external: true

Adminr should open on https://jvds.scores-catalog.org:8080 if I am not mistaken. Can anybody tell me, why this is not working?


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

KFSys
Site Moderator
Site Moderator badge
September 5, 2023

Heya,

I have a few suggestions for you to go over as from what you’ve given as information looks alright.

  1. Docker Compose Up: First, ensure you have run docker-compose up -d to start the services. You should see all services start without errors. If there’s an error, it should give you some information on what might be going wrong.

  2. Check Running Containers: Use docker ps to see if all the containers (Adminer, Directus, and Redis) are up and running. If any of them has exited or shows a restart loop, that’s a clue.

  3. Adminer Service: The Adminer service is set to map port 8080 of the host to port 8080 of the container. This means if you access https://jvds.scores-catalog.org:8080, it should indeed bring up Adminer’s interface.

    • SSL Configuration: Since you’re using https://, it implies SSL is set up. However, the adminer:standalone image doesn’t handle SSL by default. If you don’t have an external SSL proxy set up, you might want to try accessing Adminer over HTTP instead: http://jvds.scores-catalog.org:8080.

    • Firewall: Ensure that your DigitalOcean droplet firewall settings allow incoming traffic on port 8080.

  4. Logs: If you can’t figure out the problem from the running containers, look at the logs:

docker-compose logs adminer_jvds

This should show you if the Adminer service has encountered any errors or issues.

  1. Accessing SQLite via Adminer: Once you get Adminer running, to connect to the SQLite database used by Directus, you’ll need to:

    • Set the database type to SQLite3 in Adminer.
    • The database server can be left empty or set to localhost.
    • For the database field, use the full path to the SQLite file. Given your volumes mapping, it might be /directus/database/[your_database_name].db. Ensure that this SQLite file has the correct permissions to allow Adminer to read and write.
  2. Ensure Network Connectivity: Given that all your services are on the same network (jvds), they should be able to communicate with each other. However, ensure that the jvds network is correctly set up and doesn’t have any restrictions.

Lastly, if you’ve made changes based on this troubleshooting, don’t forget to restart your Docker services.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel