diff --git a/blueprints/hoppscotch/docker-compose.yml b/blueprints/hoppscotch/docker-compose.yml new file mode 100644 index 00000000..64795f5b --- /dev/null +++ b/blueprints/hoppscotch/docker-compose.yml @@ -0,0 +1,74 @@ +version: "3.8" + +services: + hoppscotch: + image: hoppscotch/hoppscotch:latest + restart: unless-stopped + depends_on: + postgres: + condition: service_healthy + migrate: + condition: service_completed_successfully + expose: + - 80 + environment: + # Database + DATABASE_URL: "${DATABASE_URL}" + DATA_ENCRYPTION_KEY: "${DATA_ENCRYPTION_KEY}" + HOPP_AIO_ALTERNATE_PORT: "${HOPP_AIO_ALTERNATE_PORT}" + WHITELISTED_ORIGINS: "${WHITELISTED_ORIGINS}" + + # Frontend config + VITE_BASE_URL: "${VITE_BASE_URL}" + VITE_SHORTCODE_BASE_URL: "${VITE_SHORTCODE_BASE_URL}" + VITE_ADMIN_URL: "${VITE_ADMIN_URL}" + + # Backend config + VITE_BACKEND_GQL_URL: "${VITE_BACKEND_GQL_URL}" + VITE_BACKEND_WS_URL: "${VITE_BACKEND_WS_URL}" + VITE_BACKEND_API_URL: "${VITE_BACKEND_API_URL}" + + # Optional UI links + VITE_APP_TOS_LINK: "${VITE_APP_TOS_LINK}" + VITE_APP_PRIVACY_POLICY_LINK: "${VITE_APP_PRIVACY_POLICY_LINK}" + + # Subpath access + ENABLE_SUBPATH_BASED_ACCESS: "true" + + volumes: + - hoppscotch-data:/app/data + + postgres: + image: postgres:16 + restart: unless-stopped + expose: + - 5432 + environment: + POSTGRES_DB: "${POSTGRES_DB}" + POSTGRES_USER: "${POSTGRES_USER}" + POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}" + volumes: + - hoppscotch-postgres:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"] + interval: 10s + timeout: 5s + retries: 5 + + migrate: + image: hoppscotch/hoppscotch:latest + depends_on: + postgres: + condition: service_healthy + entrypoint: ["/bin/sh", "-c"] + command: + - | + echo "Running database migrations..." + pnpm dlx prisma migrate deploy && echo "Migration complete!" + environment: + DATABASE_URL: "${DATABASE_URL}" + restart: "no" + +volumes: + hoppscotch-data: + hoppscotch-postgres: diff --git a/blueprints/hoppscotch/image.png b/blueprints/hoppscotch/image.png new file mode 100644 index 00000000..96f6ede5 Binary files /dev/null and b/blueprints/hoppscotch/image.png differ diff --git a/blueprints/hoppscotch/template.toml b/blueprints/hoppscotch/template.toml new file mode 100644 index 00000000..c295f814 --- /dev/null +++ b/blueprints/hoppscotch/template.toml @@ -0,0 +1,41 @@ +[variables] +main_domain = "${domain}" +db_password = "${password:32}" +encryption_key = "${password:32}" + +[config] + +[[config.domains]] +serviceName = "hoppscotch" +port = 80 +host = "${main_domain}" +path = "/" + +[config.env] +# Database & Encryption +POSTGRES_DB = "hoppscotch" +POSTGRES_USER = "hoppscotch" +POSTGRES_PASSWORD = "${db_password}" +DATABASE_URL = "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}" +DATA_ENCRYPTION_KEY = "${encryption_key}" + +# AIO Port +HOPP_AIO_ALTERNATE_PORT = "80" + +# Whitelist / Routing +WHITELISTED_ORIGINS = "https://${main_domain},http://${main_domain},app://hoppscotch" +VITE_BASE_URL = "https://${main_domain}" +VITE_SHORTCODE_BASE_URL = "https://${main_domain}" +VITE_ADMIN_URL = "https://${main_domain}/admin" +VITE_BACKEND_GQL_URL = "https://${main_domain}/backend/graphql" +VITE_BACKEND_WS_URL = "wss://${main_domain}/backend/graphql" +VITE_BACKEND_API_URL = "https://${main_domain}/backend/v1" + +# Legal Links +VITE_APP_TOS_LINK = "https://docs.hoppscotch.io/support/terms" +VITE_APP_PRIVACY_POLICY_LINK = "https://docs.hoppscotch.io/support/privacy" + +# Subpath Access +ENABLE_SUBPATH_BASED_ACCESS = "true" + +[[config.mounts]] \ No newline at end of file diff --git a/meta.json b/meta.json index 5468f3a6..d0a7afec 100644 --- a/meta.json +++ b/meta.json @@ -2676,6 +2676,25 @@ "server" ] }, + { + "id": "hoppscotch", + "name": "Hoppscotch (AIO + Migrations)", + "version": "latest", + "description": "Hoppscotch Community Edition (All-in-One) with automatic database migrations. Includes backend, frontend, and admin under unified subpath routing.", + "logo": "image.png", + "tags": [ + "api", + "testing", + "development", + "postman-alternative", + "graphql" + ], + "links": { + "website": "https://hoppscotch.io/", + "github": "https://github.com/hoppscotch/hoppscotch", + "docs": "https://docs.hoppscotch.io/documentation/self-host/community-edition/install-and-build" + } + }, { "id": "hortusfox", "name": "HortusFox",