-
Let's say I have this: var minio = builder
.AddContainer("minio", "minio/minio")
.WithEnvironment("MINIO_ROOT_USER", "blah")
.WithEnvironment("MINIO_ROOT_PASSWORD", "blah")
.WithVolume("storage", "/minio")
.WithArgs(["server", "--console-address", $"0.0.0.0:{minioConsolePort}", "--address", $"0.0.0.0:{minioApiPort}", "--compat", "/minio"])
.WithHttpEndpoint(minioConsolePort, minioConsolePort, "console")
.WithHttpEndpoint(minioApiPort, minioApiPort, "api")
.WithExternalHttpEndpoints()
;
var proxy = builder
.AddContainer("nginx-proxy", "nginx")
.WithBindMount("./nginx.linux.conf", "/etc/nginx/nginx.conf", true)
.WithBindMount("./ssl.pem", "/keys/ssl.pem")
.WithBindMount("./ssl.key", "/keys/ssl.key")
.WithHttpsEndpoint(443, 443)
.WithReference(minio.GetEndpoint("console"))
.WithExternalHttpEndpoints()
; Given that I'm running nginx, would this be the correct way of referring to the service?
(apologies for rookie mistakes, I've been spending this last little bit finally sharpening up on Aspire after Build 2024 😉 ) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 12 replies
-
The correct way is using environment variables, but nginx configuration doesn't readily support environment variables in all of the places so the next best thing is hardcoding ports.
We'll need to built-in support for rewriting files with env variables within bind mounts for containers. |
Beta Was this translation helpful? Give feedback.
-
You could try setting |
Beta Was this translation helpful? Give feedback.
You could try setting
"--network", "host"
via the same RuntimeArgs override method, but I'm suspicious we'll start throwing service endpoint errors as that's not a scenario we currently support; there's definitely some code that assumes containers are running attached to a Docker bridge network.