Associate docker-compose as file type

Answered

It appears that when creating docker-compose files some of them automatically get detected as the DC file type upon indexing, however when creating a new docker-compose file there is no DC file option within the menu(Can see Dockerfile as an option).

How would I go about forcing the file to have correct type association?

 

0
4 comments

IntelliJ IDEA recognizes docker-compose files by content. 

Please show the content of the file which is not recognized as docker-compose. 

1

The contents of the -review file is essentially identical to the other files minus some config changes, sample code below:

version: '3.7'
services:
elasticsearch-review:
build:
dockerfile: ${PWD}/Dockerfile-ES
context: ${PWD}/
# image: docker.elastic.co/elasticsearch/elasticsearch:7.4.0
ports:
- 9302:9300
- 9202:9200
environment:
- http.cors.enabled=true
- http.cors.allow-origin=*
- http.cors.allow-methods=OPTIONS,HEAD,GET,POST,PUT,DELETE
- http.cors.allow-headers=X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization
- transport.host=127.0.0.1
- cluster.name=docker-cluster-review
- discovery.type=single-node
- "ES_JAVA_OPTS=-Xms1g -Xmx2g"
- node.max_local_storage_nodes=2




0

On the initial screenshot, the file is not recognized even as yaml. May you check "Preferences | Editor | File Types | Yaml"? Does it help to rename file somehow? Maybe there is a pattern under "Settings (Preferences on macOS) | Editor | File Types | Text" which fits only one file name? 

0

 

 

 

I have not edited any of my file type associations, so initially there was only *.yaml , *yml

I then tried manually associating the file type as YAML and it now appears correctly as a DC file. (I didn't know that DC fell under the file type YAML and had a different icon, maybe this could be made more clear)

Rather odd that it wasn't able to do this automatically it begin with but at least the problem is solved.

 

Thanks for the help!

0

Please sign in to leave a comment.