I have an nginx config file with a line such as:
location / {
proxy_pass http://my-container:1234;
}
Problem is, this changes over time, depending on which machine, to things like:
my-container-my-container-1
my-container_my-container-1
my-container-my-container_1
How do I keep docker container names consistent when working with docker-compose.yml files?
docker-compose.yml:
version: '3.7'
services:
nginx:
image: nginx:stable-alpine
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
ports:
- 80:80
restart: always
depends_on:
- my-container
my-container:
build: .
expose:
- 1234