# docker-compose, mount live database from host

**URL:** <https://forums.balena.io/t/docker-compose-mount-live-database-from-host/364990>\
**Category:** balenaEngine\
**Tags:** docker, dockerfile\
**Created:** [October 21, 2022, 5:46am UTC](https://forums.balena.io/t/docker-compose-mount-live-database-from-host/364990 "2022-10-21T05:46:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![veera](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/veera/32/8494_2.png) [@veera](https://forums.balena.io/u/veera)\
**Post date:** [October 21, 2022, 5:46am UTC](https://forums.balena.io/t/docker-compose-mount-live-database-from-host/364990/1 "2022-10-21T05:46:27Z")

</div>

My goal is to have a program running on the `host` machine that writes data to a `sqlite` db that is then transferred (mounted) to a docker-compose running Grafana.

It is possible to do this with the following configuration

```auto
grafana:
    container_name: grafana
    networks:
      - backend
    image: grafana/grafana:latest
    volumes:
      - ../database/database.sqlite:/home/grafana/database.sqlite
      - ./grafana/grafana.ini:/etc/grafana/grafana.ini
      - ./grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yaml
    ports:
      - 3000:3000

networks:
  backend:

volumes:
  grafana_data:
    external: true

```

However, this will only mount the DB at the time of creation, any new changes written to the `db` will not be reflected on the container.

How can I solve this?

---

<div class="post-metadata">

**Author:** ![mcraa](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mcraa/32/6648_2.png) [@mcraa](https://forums.balena.io/u/mcraa)\
**Post date:** [October 21, 2022, 2:10pm UTC](https://forums.balena.io/t/docker-compose-mount-live-database-from-host/364990/2 "2022-10-21T14:10:08Z")

</div>

I assume you want to achieve something on balenaCloud since you are asking in the balena forums.  
I don’t understand completely your use case, but it sounds like you need a volume and mount that in the source and the reader container as well.

> **[Communicate outside the container - Balena Documentation](https://www.balena.io/docs/learn/develop/runtime/#storage)**
>
> Talk to the host OS, supervisor, and network from within a balena container
