# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: code-server
spec:
    description: Run VS Code on any machine anywhere and access it in the browser.
    coverImage: https://github.com/coder/code-server/raw/main/docs/assets/screenshot-1.png
    icon: https://avatars.githubusercontent.com/u/95932066
    variables:
        - key: PUBLIC_DOMAIN
          type: DOMAIN
          name: Domain
          description: The domain name of your code-server.
    tags:
        - Tool
    readme: |-
        # Coder

        Run Visual Studio Code (VS Code) on any machine and access it through your web browser.

        ## Deployment

        This is for out-of-the-box usage. **However, Zeabur is not suitable for development, and you will be warned if your resource usage is heavy.**

        The password can be seen in the instruction.

        Your VS Code configuration is stored at `/home/coder/.local/share/code-server`, while your projects should be stored at `/home/coder/project`. Other files and settings are **not persisted** and will be cleaned up after a restart.

        To modify your code-server settings, create a configuration file at `/home/coder/.config/code-server/config.json` with Config Editor.
    services:
        - name: code-server
          icon: https://avatars.githubusercontent.com/u/95932066
          template: PREBUILT
          spec:
            id: code-server
            source:
                image: docker.io/codercom/code-server
            ports:
                - id: web
                  port: 8080
                  type: HTTP
            volumes:
                - id: config
                  dir: /root/.local
                - id: project
                  dir: /root/project
            instructions:
                - title: Coder password
                  content: ${PASSWORD}
            env:
                DOCKER_USER:
                    default: root
          domainKey: PUBLIC_DOMAIN
