# code-server: VS Code in the browser # Image: linuxserver/code-server - lightweight, s6 overlay, PUID/PGID support # Access: http://:8443 Set PASSWORD in yml or Portainer stack env; if empty, one is generated and saved to /config/.password-generated (and logged on first run). version: "3.8" services: code-server: image: lscr.io/linuxserver/code-server:latest container_name: code-server restart: unless-stopped ports: - "8443:8443" environment: - PUID=1000 - PGID=1000 - TZ=Europe/Sofia - PASSWORD= - SUDO_PASSWORD= - PROXY_DOMAIN=code-server - DEFAULT_WORKSPACE=/config/workspace volumes: - code-server-config:/config - code-server-workspace:/config/workspace cap_add: - NET_BIND_SERVICE command: > sh -c ' if [ -z "$$PASSWORD" ]; then if [ -f /config/.password-generated ]; then export PASSWORD=$$(cat /config/.password-generated); else export PASSWORD=$$(openssl rand -hex 16); echo "$$PASSWORD" > /config/.password-generated; echo "Generated code-server password (saved in /config/.password-generated): $$PASSWORD"; fi; fi; HOME=/config git config --global http.postBuffer 524288000; HOME=/config git config --global http.lowSpeedLimit 0; HOME=/config git config --global http.lowSpeedTime 999999; [ -f /config/.gitconfig ] && chown $${PUID}:$${PGID} /config/.gitconfig; exec /init ' volumes: code-server-config: code-server-workspace: