From 0e5a67b052b91a9cdc78cf52ed35029554fd6552 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Mon, 12 Sep 2022 12:44:56 -0500 Subject: [PATCH 1/4] Add support for `coder tunnel` in docker-compose CODER_ACCESS_URL=https://coder.ben.com docker-compose up # if you have a domain CODER_TUNNEL=true docker-compose up # if you want to use Coder's tunnel --- docker-compose.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 0e66c5140606f..b52fdc7bba91d 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -8,11 +8,14 @@ services: - "7080:7080" environment: CODER_PG_CONNECTION_URL: "postgresql://${POSTGRES_USER:-username}:${POSTGRES_PASSWORD:-password}@database/${POSTGRES_DB:-coder}?sslmode=disable" + CODER_ADDRESS: "0.0.0.0:7080" # 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" CODER_ACCESS_URL: "${CODER_ACCESS_URL}" + # Alternatively, you can enable CODER_TUNNEL for + # proof-of-concept deployments. + CODER_TUNNEL: "${CODER_TUNNEL:-false}" volumes: - /var/run/docker.sock:/var/run/docker.sock depends_on: From 8a6147c8b3d48f2cc844c0db505ddc0b1a551381 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Mon, 12 Sep 2022 13:54:45 -0400 Subject: [PATCH 2/4] add docs for docker-compose tunnel --- docs/admin/configure.md | 2 ++ docs/install/docker.md | 19 +++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/docs/admin/configure.md b/docs/admin/configure.md index b6dc217cda8f7..68e2273407224 100644 --- a/docs/admin/configure.md +++ b/docs/admin/configure.md @@ -12,6 +12,8 @@ This is a quick way to allow users and workspaces outside your LAN to connect to that users and workspaces use to connect to Coder (e.g. https://coder.example.com). This should not be localhost. +> Access URL should be a external IP address or domain with DNS records pointing to Coder. + ## PostgreSQL Database Coder uses a PostgreSQL database to store users, workspace metadata, and other deployment information. diff --git a/docs/install/docker.md b/docs/install/docker.md index f6415579c6917..cf124c30d963e 100644 --- a/docs/install/docker.md +++ b/docs/install/docker.md @@ -54,16 +54,27 @@ an PostgreSQL container and volume. 3. Start Coder with `docker-compose up`: - In order to use cloud-based templates (e.g. Kubernetes, AWS), you must set `CODER_ACCESS_URL` to the external URL that users and workspaces will use to connect to Coder. + In order to use cloud-based templates (e.g. Kubernetes, AWS), you must have an external URL that users and workspaces will use to connect to Coder. + + For proof-of-concept deployments, you can use [Coder's tunnel](../admin/configure.md#tunnel): - ```console + ```sh + cd coder + + CODER_TUNNEL=true + docker-compose up + ``` + + For production deployments, we recommend setting an [access URL](../admin/configure.md#access-url): + + ```sh cd coder - CODER_ACCESS_URL=https://coder.example.com + CODER_ACCESS_URL=https://coder.example.com # URL that docker-compose up ``` - > Without `CODER_ACCESS_URL` set, Coder will bind to `localhost:7080`. This will only work for Docker-based templates. + > Without `CODER_ACCESS_URL` or `CODER_TUNNEL` set, Coder will bind to `localhost:7080`. This will only work for Docker-based templates. 4. Follow the on-screen instructions log in and create your first template and workspace From 53cb35cd955d5e7db6584618e471a0525e456d9b Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Mon, 12 Sep 2022 13:05:46 -0500 Subject: [PATCH 3/4] Update docs/install/docker.md Co-authored-by: Joe Previte --- docs/install/docker.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/install/docker.md b/docs/install/docker.md index cf124c30d963e..6cbfc8f8bf78f 100644 --- a/docs/install/docker.md +++ b/docs/install/docker.md @@ -61,8 +61,7 @@ an PostgreSQL container and volume. ```sh cd coder - CODER_TUNNEL=true - docker-compose up + CODER_TUNNEL=true docker-compose up ``` For production deployments, we recommend setting an [access URL](../admin/configure.md#access-url): From 65642b7ea4e11eec2ee7ac0fd10012a8f8ee9b87 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Mon, 12 Sep 2022 13:06:07 -0500 Subject: [PATCH 4/4] Update docs/install/docker.md --- docs/install/docker.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/install/docker.md b/docs/install/docker.md index 6cbfc8f8bf78f..df08c4fb2962b 100644 --- a/docs/install/docker.md +++ b/docs/install/docker.md @@ -69,8 +69,7 @@ an PostgreSQL container and volume. ```sh cd coder - CODER_ACCESS_URL=https://coder.example.com # URL that - docker-compose up + CODER_ACCESS_URL=https://coder.example.com docker-compose up ``` > Without `CODER_ACCESS_URL` or `CODER_TUNNEL` set, Coder will bind to `localhost:7080`. This will only work for Docker-based templates.