# Add Liquibase with docker-compose

**URL:** <https://forum.liquibase.org/t/add-liquibase-with-docker-compose/6891>\
**Category:** Liquibase Development\
**Created:** [May 26, 2022, 4:06am UTC](https://forum.liquibase.org/t/add-liquibase-with-docker-compose/6891 "2022-05-26T04:06:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![leofierusOffice](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/leofierusoffice/32/772_2.png) [@leofierusOffice](https://forum.liquibase.org/u/leofierusOffice)\
**Post date:** [May 26, 2022, 4:06am UTC](https://forum.liquibase.org/t/add-liquibase-with-docker-compose/6891/1 "2022-05-26T04:06:01Z")

</div>

So I am trying to integrate my liquibase with an already existing docker image of Postgres. There are already images of `frontend` and `backend` in the `docker-compose.yml` file and I have my changelog scripts too but I am not sure how to proceed with integrating the `liquibase changelog` in the already existing `docker-changelog.yml`.  
Any cues on how to proceed?

This is my example **docker-compose.yml** file:

```auto
version: '3'
services:
    PostgreSQL:
        # service details
    Liquibase:
        # service details
    Backend:
        # service details
    Frontend:
        # service details

```

My `Postgres` changelog has database updation scripts and everything, I just don’t know how to proceed with adding those in the docker-compose file to run and create everything with the command:

```auto
docker-compose up -d

```

---

<div class="post-metadata">

**Author:** ![leofierusOffice](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/leofierusoffice/32/772_2.png) [@leofierusOffice](https://forum.liquibase.org/u/leofierusOffice)\
**Post date:** [May 30, 2022, 6:54am UTC](https://forum.liquibase.org/t/add-liquibase-with-docker-compose/6891/2 "2022-05-30T06:54:31Z")

</div>

So I got a way to handle the `liquibase update` command. Here’s what I used as my Liquibase service, if it helps anyone:

```auto
Liquibase:
    # Image to be pulled from Docker Hub
    image: liquibase/liquibase:4.9.1
    # Name of the container
    container_name: Liquibase_container
    # Setting depends_on to PostgreSQL container to wait till the service is ready to accept connections
    depends_on:
      PostgreSQL:
        condition: service_healthy
    # Volume to add the liquibase collection of scripts
    volumes:
      - ./database/sql/liquibase/changeLog/:/liquibase/changelog/
    # Command to run the liquibase update service
    command: --defaults-file=/liquibase/changelog/liquibase.properties update

```

I moved my `changeLog` files to a volume inside the container named `liquibase/changelog` and then used the command to run `update`.
