Clone this repository to run a TLS-enabled Coder deployment on Docker. The docker-compose.yaml file defines the Coder container and an nginx reverse proxy to route traffic over HTTPS. It also includes the linuxserver/letsencrypt image to handle DNS validation for your domain, if necessary.
Note that a domain is not required to run Coder on Docker. To access Coder over localhost, use the command below:
docker run --rm -it -p 7080:7080 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ~/.coder:/var/run/coder \
codercom/coder:1.25.1-
Docker v17.12.0+ and Compose v1.21.0+
-
Docker Desktop
-
A domain
-
SSL certificate (can be acquired via step 1 below)
-
Navigate to the
docker-compose.yamlfile and comment out thecoder&nginxcontainers -
Change the following variables for the
letsencryptcontainer:
-
Set
PUIDandPGIDto owner of the folder where you are mounting the volume -
Set
URLto your domain andDNSPLUGINto your DNS provider - supported providers -
(Optional) Set
EMAIL&TZto the relevant values
- Leave the following variables as is:
-
SUBDOMAINS=wildcard -
DHLEVEL=4096 -
VALIDATION=dns
- Mount the volume to a folder that doesn't yet exist.
Docker will automatically create the folder, and populate it with the contents of the container, which in this case, will be various
.inifiles.
-
Run
docker-compose up -d -
Navigate to
/path/to/config/dns-confand update your DNS provider's.inifile with the required values -
Run
docker-compose restart letsencrypt
You should now see your SSL certificate files in /path/to/config/etc/letsencrypt/live/example.com.
In contrast to the letsencrypt container, the nginx container requires having a config folder on your host. An nginx.conf configuration file is required on the host machine, and is included in the nginx directory of this repository.
- Navigate to the
nginx.conffile and update the following variables with the appropriate values:
-
server_name <example.com> -
ssl_certificate <letsencrypt/path/to/cert/cert.pem> -
ssl_certificate_key <letsencrypt/path/to/cert/key/privkey.pem>
Both the config and certificate files will be mounted to the etc/nginx & letsencrypt directories inside the container, respectively.
- Run
docker-compose up
-
Access Coder via your secure domain
-
Enter the
admincredentials generated from the container logs -
Navigate to Manage > Admin > Infrastructure and update the Access URL with your domain