diff --git a/apps/dokploy/public/templates/coder.svg b/apps/dokploy/public/templates/coder.svg new file mode 100644 index 000000000..56d2f77c3 --- /dev/null +++ b/apps/dokploy/public/templates/coder.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/dokploy/templates/coder/docker-compose.yml b/apps/dokploy/templates/coder/docker-compose.yml new file mode 100644 index 000000000..184db31d3 --- /dev/null +++ b/apps/dokploy/templates/coder/docker-compose.yml @@ -0,0 +1,41 @@ +services: + coder: + image: ghcr.io/coder/coder:v2.15.3 + networks: + - dokploy-network + ports: + - "7080:7080" + volumes: + - /var/run/docker.sock:/var/run/docker.sock + group_add: + - "998" + depends_on: + db: + condition: service_healthy + environment: + - CODER_ACCESS_URL + - CODER_HTTP_ADDRESS + - CODER_PG_CONNECTION_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db/${POSTGRES_DB}?sslmode=disable + + db: + image: postgres:17 + networks: + - dokploy-network + environment: + - POSTGRES_PASSWORD + - POSTGRES_USER + - POSTGRES_DB + healthcheck: + test: + [ + "CMD-SHELL", + "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}", + ] + interval: 5s + timeout: 5s + retries: 5 + volumes: + - db_coder_data:/var/lib/postgresql/data + +volumes: + db_coder_data: \ No newline at end of file diff --git a/apps/dokploy/templates/coder/index.ts b/apps/dokploy/templates/coder/index.ts new file mode 100644 index 000000000..c3f066d63 --- /dev/null +++ b/apps/dokploy/templates/coder/index.ts @@ -0,0 +1,30 @@ +import { + type DomainSchema, + type Schema, + type Template, + generateRandomDomain, +} from "../utils"; + +export function generate(schema: Schema): Template { + const domains: DomainSchema[] = [ + { + host: generateRandomDomain(schema), + port: 7080, + serviceName: "coder", + }, + ]; + + const envs = [ + "CODER_ACCESS_URL=", + "CODER_HTTP_ADDRESS=0.0.0.0:7080", + "", + "POSTGRES_DB=coder", + "POSTGRES_USER=coder", + "POSTGRES_PASSWORD=VERY_STRONG_PASSWORD", + ]; + + return { + domains, + envs, + }; +} diff --git a/apps/dokploy/templates/templates.ts b/apps/dokploy/templates/templates.ts index 09d1273b4..e5219de6a 100644 --- a/apps/dokploy/templates/templates.ts +++ b/apps/dokploy/templates/templates.ts @@ -659,4 +659,19 @@ export const templates: TemplateData[] = [ tags: ["self-hosted", "open-source", "os"], load: () => import("./macos/index").then((m) => m.generate), }, + { + id: "coder", + name: "Coder", + version: "2.15.3", + description: + "Coder is an open-source cloud development environment (CDE) that you host in your cloud or on-premises.", + logo: "coder.svg", + links: { + github: "https://github.com/coder/coder", + website: "https://coder.com/", + docs: "https://coder.com/docs", + }, + tags: ["self-hosted", "open-source", "builder"], + load: () => import("./coder/index").then((m) => m.generate), + }, ];