1 Workspace, multiple container, coder_app on each
I hope this is a quick question: I've been playing with the docker version of coder to see what it can do, and was wondering whether it's possible to use multiple containers in a single workspace and expose multiple
coder_app
s via a Terraform template, where each coder_app resides on a different container.
I thought the URL parameter in the coder_app
would enable this, but it returns a "502 - Bad Gateway" for the app that isn't running on the coder_workspace container. My presumption is that it only tries to proxy to localhost, since the error looks like it's failing to connect to an [<IPv6_addr>]:80 and the agent log appears to have entries failing to connect to localhost:80.
I'm basing the work on the Docker Containers
template.Solution:Jump to solution
Yes you are correct. Your solution is to run an agent in each container where you want to expose a coder_app
7 Replies
<#1246190805769519236>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
I think I may have answered my own question, but please correct me if I'm wrong. In coder/tailnet.go, line 348 is the ReverseProxy function. In that function, the doc string indicates that it points the URL to the agent's IP, and lines 354 and 355 appear to strip out the IP and replace it with an IPv6 address generated from a UUID. So, unless I can run an agent on multiple containers, only one container (the workspace container) can host a coder_app
Solution
Yes you are correct. Your solution is to run an agent in each container where you want to expose a coder_app
Hi @greg I found your post via the search function. Have you been successful? I am trying the same, setting up one workspace with multiple docker containers, that run an agent.
Not yet. I'm having trouble with multiple agents. I haven't worked out why multiple agents won't display yet. I expect it has to do with some identifier somewhere
Each agent should have a unique name. If you face any issues please share your template
Sorry to not have responded; I have multiple experiments going. Is there an coder agent build for an alpine-based system?