version: '3.6' services: {{ mysql_service_name }}: image: {{ mysql_image_nameĀ }} ports: - "3306:3306" environment: MYSQL_USER: "{{ jdbc_user }}" MYSQL_PASSWORD: "{{ jdbc_pass }}" MYSQL_DB: "{{ jdbc_db }}" {% if init_db %} configs: - source: db-init target: "/docker-entrypoint-initdb.d/db-init.sql" {% endif %} networks: - {{ conductor_network }} deploy: replicas: {{ mysql_replicas }} placement: constraints: [node.role == worker] networks: {{ conductor_network }}: {% if init_db %} configs: db-init: file: {{ target_path }}/conductor-db-init.sql {% endif %}