'Service in docker container doesn't start automatically when launching docker-desktop, but does so after restart

I have a docker container running airflow. For this I used the docker-compose, which is provided in the docs. Since I want the scripts run by airflow to get data from a MinIO S3 Bucket, I wanted to add a separate service running the MinIO server to this container. So I adapted the docker-compose as follows:

version: '3'
x-airflow-common:
  &airflow-common
  build: .
  environment:
    ...

  volumes:
    ...
  user: "***"
  depends_on:
    &airflow-common-depends-on
    redis:
      condition: service_healthy
    postgres:
      condition: service_healthy
    minio-data:
      condition: service_started

   ...

   services:
    ...
      minio-data:
        image: minio/minio
        ports:
          - 9000:9000
          - 9001:9001
        volumes:
          - path\to\my\local\data:/data
    environment:
      - MINIO_ROOT_USER=****
      - MINIO_ROOT_PASSWORD=****
    command: server /data --console-address ":9001"

For the most part this works fine, however the MinIO service doesn't not start automatically after launching docker. If I completely stop and restart the complete container (using stop and start button in docker-desktop for Windows), it will start.

Ho do I have to modify the docker-compose, in order to have MinIO always running?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source