mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
chore: remove docker host from docker-compose (#1596)
This commit is contained in:
+4
-3
@@ -6,10 +6,11 @@ services:
|
||||
- "7080:7080"
|
||||
environment:
|
||||
CODER_PG_CONNECTION_URL: "postgresql://${POSTGRES_USER:-username}:${POSTGRES_PASSWORD:-password}@database/${POSTGRES_DB:-coder}?sslmode=disable"
|
||||
# You'll need to set CODER_ACCESS_URL to an IP or domain
|
||||
# that workspaces can reach. This cannot be localhost
|
||||
# or 127.0.0.1 for non-Docker templates!
|
||||
CODER_ADDRESS: "0.0.0.0:7080"
|
||||
# You'll need to set CODER_ACCESS_URL to an
|
||||
# externally-reachable IP to use non-Docker examples!
|
||||
CODER_ACCESS_URL: "${CODER_ACCESS_URL:-http://host.docker.internal:7080}"
|
||||
CODER_ACCESS_URL: "${CODER_ACCESS_URL}"
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
depends_on:
|
||||
|
||||
@@ -94,8 +94,9 @@ resource "docker_container" "workspace" {
|
||||
# Hostname makes the shell more user friendly: coder@my-workspace:~$
|
||||
hostname = lower(data.coder_workspace.me.name)
|
||||
dns = ["1.1.1.1"]
|
||||
command = ["sh", "-c", coder_agent.dev.init_script]
|
||||
env = ["CODER_AGENT_TOKEN=${coder_agent.dev.token}"]
|
||||
# Use the docker gateway if the access URL is 127.0.0.1
|
||||
command = ["sh", "-c", replace(coder_agent.dev.init_script, "127.0.0.1", "host.docker.internal")]
|
||||
env = ["CODER_AGENT_TOKEN=${coder_agent.dev.token}"]
|
||||
host {
|
||||
host = "host.docker.internal"
|
||||
ip = "host-gateway"
|
||||
|
||||
@@ -47,7 +47,6 @@ variable "step2_arch" {
|
||||
provider "docker" {
|
||||
host = "unix:///var/run/docker.sock"
|
||||
}
|
||||
|
||||
provider "coder" {
|
||||
}
|
||||
|
||||
@@ -82,8 +81,9 @@ resource "docker_container" "workspace" {
|
||||
# Hostname makes the shell more user friendly: coder@my-workspace:~$
|
||||
hostname = lower(data.coder_workspace.me.name)
|
||||
dns = ["1.1.1.1"]
|
||||
command = ["sh", "-c", coder_agent.dev.init_script]
|
||||
env = ["CODER_AGENT_TOKEN=${coder_agent.dev.token}"]
|
||||
# Use the docker gateway if the access URL is 127.0.0.1
|
||||
command = ["sh", "-c", replace(coder_agent.dev.init_script, "127.0.0.1", "host.docker.internal")]
|
||||
env = ["CODER_AGENT_TOKEN=${coder_agent.dev.token}"]
|
||||
host {
|
||||
host = "host.docker.internal"
|
||||
ip = "host-gateway"
|
||||
|
||||
Reference in New Issue
Block a user