mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
feat(template): added answer template
This commit is contained in:
parent
4d5565895c
commit
165cdd27da
BIN
apps/dokploy/public/templates/answer.png
Normal file
BIN
apps/dokploy/public/templates/answer.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.7 KiB |
31
apps/dokploy/templates/answer/docker-compose.yml
Normal file
31
apps/dokploy/templates/answer/docker-compose.yml
Normal file
@ -0,0 +1,31 @@
|
||||
services:
|
||||
answer:
|
||||
image: apache/answer:1.4.1
|
||||
ports:
|
||||
- '9080: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:
|
33
apps/dokploy/templates/answer/index.ts
Normal file
33
apps/dokploy/templates/answer/index.ts
Normal file
@ -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,
|
||||
};
|
||||
}
|
@ -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),
|
||||
},
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user