diff --git a/apps/dokploy/public/templates/answer.png b/apps/dokploy/public/templates/answer.png new file mode 100644 index 00000000..3fca604d Binary files /dev/null and b/apps/dokploy/public/templates/answer.png differ diff --git a/apps/dokploy/templates/answer/docker-compose.yml b/apps/dokploy/templates/answer/docker-compose.yml new file mode 100644 index 00000000..e17a6d1e --- /dev/null +++ b/apps/dokploy/templates/answer/docker-compose.yml @@ -0,0 +1,31 @@ +services: + answer: + image: apache/answer:1.4.1 + ports: + - '80' + restart: on-failure + volumes: + - answer-data:/data + depends_on: + db: + condition: service_healthy + db: + image: postgres:16 + restart: always + healthcheck: + test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] + interval: 5s + timeout: 5s + retries: 5 + networks: + - dokploy-network + volumes: + - db-data:/var/lib/postgresql/data + environment: + POSTGRES_DB: answer + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + +volumes: + answer-data: + db-data: diff --git a/apps/dokploy/templates/answer/index.ts b/apps/dokploy/templates/answer/index.ts new file mode 100644 index 00000000..36d48cb3 --- /dev/null +++ b/apps/dokploy/templates/answer/index.ts @@ -0,0 +1,33 @@ +import { + type DomainSchema, + type Schema, + type Template, + generateHash, + generateRandomDomain, +} from "../utils"; + +export function generate(schema: Schema): Template { + const mainServiceHash = generateHash(schema.projectName); + const mainDomain = generateRandomDomain(schema); + + const domains: DomainSchema[] = [ + { + host: mainDomain, + port: 9080, + serviceName: "answer", + }, + ]; + + const envs = [ + `ANSWER_HOST=http://${mainDomain}`, + `SERVICE_HASH=${mainServiceHash}`, + ]; + + const mounts: Template["mounts"] = []; + + return { + envs, + mounts, + domains, + }; +} diff --git a/apps/dokploy/templates/templates.ts b/apps/dokploy/templates/templates.ts index be04033d..7ba3829f 100644 --- a/apps/dokploy/templates/templates.ts +++ b/apps/dokploy/templates/templates.ts @@ -1408,4 +1408,19 @@ export const templates: TemplateData[] = [ tags: ["file", "webdav", "storage"], load: () => import("./alist/index").then((m) => m.generate), }, + { + id: "answer", + name: "Answer", + version: "v1.4.1", + description: + "Answer is an open-source Q&A platform for building a self-hosted question-and-answer service.", + logo: "answer.png", + links: { + github: "https://github.com/apache/answer", + website: "https://answer.apache.org/", + docs: "https://answer.apache.org/docs", + }, + tags: ["q&a", "self-hosted"], + load: () => import("./answer/index").then((m) => m.generate), + }, ];