coder / code-server

VS Code in the browser
https://coder.com
MIT License
66.63k stars 5.46k forks source link

chore: add Dockerfile for VS Code Server and Caddy configuration #6710

Closed thadeucbr closed 4 months ago

thadeucbr commented 4 months ago

Description

This PR introduces a Dockerfile that sets up a VS Code Server environment. The Dockerfile is based on Ubuntu and includes installations of curl, NVM, Caddy, and VS Code Server. It also sets up a non-root user and a workplace directory for the VS Code Server.

Usage

To use this Dockerfile, please replace example.com in the Caddy configuration file with your own domain. (line 26 of Dockerfile)

Build the Docker image

docker build -t vscode-server .

Run the Docker container

docker run -p 8080:8080 vscode-server

Motivation

I created this PR because I’ve been working with a client who requires me to access their virtual machine for development. However, their environment is quite limited, and I don’t have admin access, which restricts what I can do. Hosting the VS Code Server on my server solved all my problems, so I decided to share my Dockerfile to help others who might be in a similar situation.

code-asher commented 4 months ago

Thank you for the PR! If I understand correctly, you opened this to be an example rather than replacing our existing images? If there is something we should merge in we will need to edit the existing Docker images but I am not sure we want to include Caddy as we prefer to leave the reverse proxy up to the user. If not, we can go ahead and close this.

thadeucbr commented 4 months ago

Hi code-asher! Actually, I hadn’t seen that you already had an image on dockerhub, I’m going to close the pr!