I want to set which profiles use to docker stack deploy. I mean, assume my docker-compose.yml is like this:
version: '3.8' services: admin: image: "${ADMIN_IMAGE}" restart: always profiles: - "admin" api: image: "${API_IMAGE}" restart: always profiles: - "api" redis: image: "${REDIS_IMAGE}" restart: always profiles: - "redis" And want to deploy just admin and Redis services. If it was docker-compose, then I had two options: docker compose --profile=admin --profile=redis up -d or COMPOSE_PROFILES=admin,redis docker compose up -d but I want to deploy this as a swarm stack with docker stack deploy --compose-file docker-compose.yml stack_name and I can't. Both options don't work in this situation, although docker docs says swarm supports it, but don't say how.
So my question is:
- Do docker swarm support profiles?
- If it is supported, how I use it?
- Else, how can I deploy a part of compose file?