version: '3.4' volumes: test-m2: external: true networks: backend: x-jdbc-env: &jdbc-env JDBC_TEST_JDBCURL: jdbc:mysql://db:3306/test?connectTimeout=0&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8 JDBC_TEST_USERNAME: root JDBC_TEST_PASSWORD: test services: mvn-build: image: maven:3-openjdk-11 working_dir: /usr/src/maven volumes: - .:/usr/src/maven - test-m2:/root/.m2 entrypoint: mvn clean package db: image: mariadb:10 networks: - backend ports: - "33006:3306" environment: MYSQL_ROOT_PASSWORD: test labels: traefik.enable: 'false' liquibase: image: test-db:1.0-SNAPSHOT build: context: db args: version: ${VERSION} networks: - backend command: --lb-update # cayenne helpers cdbimport: image: maven:3-openjdk-11 networks: - backend volumes: - test-m2:/root/.m2 - .:/usr/src/maven working_dir: /usr/src/maven environment: <<: *jdbc-env command: mvn -f model cayenne:cdbimport cgen: image: maven:3-openjdk-11 volumes: - test-m2:/root/.m2 - .:/usr/src/maven working_dir: /usr/src/maven environment: <<: *jdbc-env command: mvn -f model cayenne:cgen # app services # this shows a fail scenario fail: image: test-test:${VERSION} build: context: test args: version: ${VERSION} networks: - backend depends_on: - db - liquibase command: --fail # this shows off a workaround happy: image: test-test:${VERSION} build: context: test args: version: ${VERSION} networks: - backend depends_on: - db - liquibase command: --happy