How to use Dockerfile syntax highlight with `Dockerfile.production` and `Dockerfile.staging`

Hi there, I'm using Docker to setup a private image. The image will have different version based on the environment. To achive this workflow I've named the Dockerfile for production environment `Dockerfile.production` but I could not find the proper Docker syntax highlight. Maybe it's just not named Docker, but it's taken from anbother syntax highligher. I don't know.

Does anyone know how to get Dockerfile syntax highlight on the `Dockerfile.production` and `Dockerfile.staging`?

7 comments
Comment actions Permalink

Try adding both names to the list of patterns registered for Dockerfile file type in Settings | Editor | File Types:

 

7
Comment actions Permalink

Amazing. It was exactly what I was looking for, just didn't know where it was. Thanks!

1
Comment actions Permalink

Btw why do this rule not working for highlighting in some cases?

0
Comment actions Permalink

@Alex

Check entries for "Text" file type -- you may have an exact match entry there already... if so -- remove it.

1
Comment actions Permalink

In version 2021.1.2 there is no Dockerfile type in Settings | Editor | File Types. Was it removed?

0
Comment actions Permalink

@Marcin

It is there for me in PhpStorm 2021.1.3

Make sure that Docker plugin is enabled. If that plugin is disabled then the File Type entry is absent.

3
Comment actions Permalink

@Andriy

Make sure that Docker plugin is enabled. If that plugin is disabled then the File Type entry is absent.

You are right, I missed that part. Thanks!

0

Please sign in to leave a comment.