Whats is code-server?#
code-server is a self-hosted instance of Visual Studio Code that runs on a remote server and is accessible directly through your web browser. It effectively turns any machine with a CPU and RAM into a fully functional cloud-based development environment.
Docker Compose Example#
# code-server -- https://hub.docker.com/r/linuxserver/code-server
services:
code-server:
image: lscr.io/linuxserver/code-server:latest
container_name: code-server
environment:
- PUID=1000
- PGID=1000
- TZ=America/New_York
- PASSWORD=${PASSWORD}
- SUDO_PASSWORD=${SUDO_PASSWORD}
- PROXY_DOMAIN=${PROXY_DOMAIN}
- DEFAULT_WORKSPACE=${DEFAULT_WORKSPACE}
volumes:
- ${CODESERVER_DATA}/config:/config # code-server expects /code-server as default dir?
- /srv:/apps
- /var/run/docker.sock:/var/run/docker.sock # docker socket
ports:
- 8443:8443
restart: unless-stopped
networks:
- frontend
networks:
frontend:
external: true