# How to do it in the right way?

**URL:** <https://drone.discourse.group/t/how-to-do-it-in-the-right-way/10278>\
**Category:** Drone Support\
**Created:** [April 7, 2020, 6:03am UTC](https://drone.discourse.group/t/how-to-do-it-in-the-right-way/10278 "2020-04-07T06:03:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![softshipper](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/softshipper/32/5585_2.png) [@softshipper](https://drone.discourse.group/u/softshipper)\
**Post date:** [April 7, 2020, 6:03am UTC](https://drone.discourse.group/t/how-to-do-it-in-the-right-way/10278/1 "2020-04-07T06:03:20Z")

</div>

Hi all

I am trying to write my first DroneCI pipeline and struggle with the question, how to do it in the right way.  
I have a project based on maven, that first has to be to compile, to get the JAR file. After that, it should run `docker-compose` to deploy containers on the same host as the pipeline was triggered, for that, I use `drone exec runner`.

The docker-compose file:

```
version: '3.7'
services:

  postgres:
    image: postgres:12.2
    container_name: postgres
    environment:
      POSTGRES_DB: ${KC-DB}
      POSTGRES_USER: ${KC-DB-USER}
      POSTGRES_PASSWORD: ${KC-DB-PW}

  keycloak:
    image: jboss/keycloak:9.0.2
    container_name: keycloak
    environment:
      DB_VENDOR: POSTGRES
      DB_ADDR: postgres
      DB_DATABASE: ${KC-DB}
      DB_USER: ${KC-DB-USER}
      DB_PASSWORD: ${KC-DB-PW}
      KEYCLOAK_USER: ${KC-USER}
      KEYCLOAK_PASSWORD: ${KC-PW}
      PROXY_ADDRESS_FORWARDING: "true"
      TZ: UTC
      #KEYCLOAK_DEFAULT_THEME: theme-minimal
      #KEYCLOAK_LOGLEVEL: DEBUG
    command:
      - "-Dkeycloak.migration.action=import -Dkeycloak.migration.provider=dir -Dkeycloak.profile.feature.upload_scripts=enabled -Dkeycloak.migration.dir=/opt/jboss/keycloak/import-dir -Dkeycloak.migration.strategy=OVERWRITE_EXISTING"
    volumes:
      - ./config/standalone-ha.xml:/opt/jboss/keycloak/standalone/configuration/standalone-ha.xml
      - ./config/import-dir:/opt/jboss/keycloak/import-dir
      - ./theme/target/theme-${KC-THEME-VERSION}.jar:/opt/jboss/keycloak/standalone/deployments/dataxu-theme-${KC-THEME-VERSION}.jar
      - ./spi-registration-profile/target/spi-registration-profile-${KC-REGISTRATION-VERSION}.jar:/opt/jboss/keycloak/standalone/deployments/spi-registration-profile-${KC-REGISTRATION-VERSION}.jar
    external_links:
      - traefik
    depends_on:
      - postgres
      - mailhog

  mailhog:
    image: mailhog/mailhog:latest
    container_name: mailhog
    ports:
      - "8025:8025"  

```

The question is, how to do it in the right way?

Thanks
