defang icon indicating copy to clipboard operation
defang copied to clipboard

Generate should include published port

Open raphaeltm opened this issue 7 months ago • 1 comments

defang generate gave me this file:

services:
  service1:
    restart: always
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - mode: ingress
        target: 3000
    environment:
      - REDIS_HOST=redis
      - REDIS_PORT=6379
  redis:
    image: redis:alpine
    ports:
      - 6379:6379

This will work in the cloud, but not locally. If we switch it to this:

services:
  service1:
    restart: always
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - mode: ingress
        target: 3000
        published: 3000
    environment:
      - REDIS_HOST=redis
      - REDIS_PORT=6379
  redis:
    image: redis:alpine
    ports:
      - 6379:6379

It works with both. So I suggest we modify things so that published gets added as well.

raphaeltm avatar Jul 17 '24 19:07 raphaeltm