Skip to content
This repository was archived by the owner on Aug 18, 2025. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions setup/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,40 @@ multi-machine scaling.

For organizations, we recommend one Docker host per team of 5-10 developers.

## Docker Compose
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was something I had suggested before (#818 (comment)), I suppose if we're good with the additional maintenance then more options is always good

cc @Emyrk


For a convenent way to run Coder in Docker, you can use [Docker Compose](https://docs.docker.com/compose/).

Simply create a new directory (for example, named `c4d`) and place the following
content in a file named `docker-compose.yml`:

```yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the extra spaces here?

Suggested change
```yaml
```yaml

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tried keeping the current indentation level; is there anything magical about that here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, maybe my eyes deceive me - I thought this line was off compared to the rest. Disregard!


version: "3.5"
services:
coder:
image: docker.io/codercom/coder:1.28.2
container_name: coderd
restart: unless-stopped
ports:
- 7080:7080/tcp
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ${HOME}/.coder:/var/run/coder
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you nee the { }?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just a habit of mine, it's probably not necessary.


```

Then, navigate to that folder in your terminal and run the command:

```shell-session

docker-compose up -d
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be recommending docker compose up -d?

Copy link
Member Author

@johnstcn johnstcn Mar 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intentionally chose the docker-compose syntax in case folks on older versions want to try this. The new version is backwards-compatible:

$ ls -l $(which docker-compose)
lrwxr-xr-x 1 root wheel 68 Feb 27 21:05 /usr/local/bin/docker-compose -> /Applications/Docker-4.5.0.app/Contents/Resources/bin/docker-compose


```

Coder will now run in the background! For more detailed information on the
Docker Compose file, please see [Docker's website](https://docs.docker.com/compose/compose-file/compose-file-v3/).

## Known issues

Currently, Coder for Docker does not support:
Expand Down