defang
defang copied to clipboard
Generate should include published port
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.