Finished simpleicons implementation

This commit is contained in:
2025-07-07 07:25:57 +02:00
parent a51bc1f4c7
commit 63af5b8ef6
11 changed files with 129 additions and 8 deletions

View File

@@ -0,0 +1,16 @@
FROM node:latest AS builder
WORKDIR /app
COPY ./config/package*.json ./
RUN npm install
FROM node:latest
WORKDIR /app
COPY --from=builder /app/node_modules ./node_modules
COPY ./config/server.js .
EXPOSE {{ container_port }}
CMD ["node", "server.js"]

View File

@@ -6,9 +6,9 @@
image: simpleicons-server:latest
container_name: simpleicons-server
ports:
- "{{ports.localhost.http[application_id]}}:3000"
- "{{ports.localhost.http[application_id]}}:{{ container_port }}"
{% include 'roles/docker-container/templates/base.yml.j2' %}
{% include 'roles/docker-container/templates/networks.yml.j2' %}
{% include 'roles/docker-container/templates/healthcheck/curl.yml.j2' %}
{% include 'roles/docker-compose/templates/networks.yml.j2' %}

View File

@@ -0,0 +1 @@
{# This file just exists, because the framework requests it. #}

View File

@@ -0,0 +1,9 @@
{
"name": "simpleicons-server",
"type": "module",
"dependencies": {
"express": "^4.18.2",
"simple-icons": "^9.0.0",
"sharp": "^0.32.0"
}
}

View File

@@ -3,7 +3,7 @@ import * as icons from 'simple-icons';
import sharp from 'sharp';
const app = express();
const port = process.env.PORT || 3000;
const port = {{ container_port }};
// Helper: convert 'nextcloud' → 'siNextcloud'
function getExportName(slug) {
@@ -15,7 +15,7 @@ function getExportName(slug) {
// Root: redirect to your documentation
app.get('/', (req, res) => {
res.redirect('https://docs.cymais.cloud/roles/docker-{{ application_id }}/README.html');
res.redirect('{{ domains | get_url('sphinx', web_protocol) }}/roles/docker-{{ application_id }}/README.html');
});
// GET /:slug.svg