feat: docs

This commit is contained in:
2025-10-09 14:42:36 +02:00
parent 43bf2cfe7f
commit 54822058f8
6 changed files with 66 additions and 65 deletions

View File

@@ -1,2 +1,2 @@
COMPOSE_PROJECT_NAME=kompose
COMPOSE_PROJECT_NAME=docs
TRAEFIK_HOST=docs.pivoine.art

View File

@@ -1,2 +0,0 @@
# Public URL, used for OG Image when running nuxt generate
NUXT_PUBLIC_SITE_URL=

View File

@@ -1,36 +0,0 @@
# Build stage
FROM node:20-alpine AS builder
# Install pnpm
RUN npm install -g pnpm@9.0.0
WORKDIR /app
# Copy package files
COPY package.json pnpm-lock.yaml* ./
# Install dependencies
RUN pnpm install --frozen-lockfile
# Copy source code
COPY . .
# Generate static site
RUN pnpm generate
# Production stage
FROM nginx:alpine
# Copy custom nginx config
COPY nginx.conf /etc/nginx/nginx.conf
# Copy built static site
COPY --from=builder /app/.output/public /usr/share/nginx/html/kompose
# Add healthcheck
# HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
# CMD wget --quiet --tries=1 --spider http://localhost:80/ || exit 1
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

View File

@@ -2,29 +2,29 @@ name: docs
services:
docs:
build:
context: .
dockerfile: Dockerfile
image: ${DOCKER_IMAGE}
container_name: ${COMPOSE_PROJECT_NAME}_app
restart: unless-stopped
volumes:
# Mount the built static site
- ./.output/public:/usr/share/nginx/html:ro
- /var/www/docs.pivoine.art:/public
# No healthcheck - static-web-server doesn't include wget/curl
# Traefik will detect via port check
networks:
- kompose_network
labels:
- 'traefik.enable=true'
- 'traefik.http.middlewares.$COMPOSE_PROJECT_NAME-api-redirect-web-secure.redirectscheme.scheme=https'
- 'traefik.http.routers.$COMPOSE_PROJECT_NAME-api-web.middlewares=$COMPOSE_PROJECT_NAME-api-redirect-web-secure'
- 'traefik.http.routers.$COMPOSE_PROJECT_NAME-api-web.rule=Host(`$TRAEFIK_HOST`)'
- 'traefik.http.routers.$COMPOSE_PROJECT_NAME-api-web.entrypoints=web'
- 'traefik.http.routers.$COMPOSE_PROJECT_NAME-api-web-secure.rule=Host(`$TRAEFIK_HOST`)'
- 'traefik.http.routers.$COMPOSE_PROJECT_NAME-api-web-secure.tls.certresolver=resolver'
- 'traefik.http.routers.$COMPOSE_PROJECT_NAME-api-web-secure.entrypoints=web-secure'
- 'traefik.http.middlewares.$COMPOSE_PROJECT_NAME-api-web-secure-compress.compress=true'
- 'traefik.http.routers.$COMPOSE_PROJECT_NAME-api-web-secure.middlewares=$COMPOSE_PROJECT_NAME-api-web-secure-compress'
- 'traefik.http.services.$COMPOSE_PROJECT_NAME-api-web-secure.loadbalancer.server.port=80'
- 'traefik.http.middlewares.$COMPOSE_PROJECT_NAME-redirect-web-secure.redirectscheme.scheme=https'
- 'traefik.http.routers.$COMPOSE_PROJECT_NAME-web.middlewares=$COMPOSE_PROJECT_NAME-redirect-web-secure'
- 'traefik.http.routers.$COMPOSE_PROJECT_NAME-web.rule=Host(`$TRAEFIK_HOST`)'
- 'traefik.http.routers.$COMPOSE_PROJECT_NAME-web.entrypoints=web'
- 'traefik.http.routers.$COMPOSE_PROJECT_NAME-web-secure.rule=Host(`$TRAEFIK_HOST`)'
- 'traefik.http.routers.$COMPOSE_PROJECT_NAME-web-secure.tls.certresolver=resolver'
- 'traefik.http.routers.$COMPOSE_PROJECT_NAME-web-secure.entrypoints=web-secure'
- 'traefik.http.middlewares.$COMPOSE_PROJECT_NAME-web-secure-compress.compress=true'
- 'traefik.http.routers.$COMPOSE_PROJECT_NAME-web-secure.middlewares=$COMPOSE_PROJECT_NAME-web-secure-compress'
- 'traefik.http.services.$COMPOSE_PROJECT_NAME-web-secure.loadbalancer.server.port=80'
- 'traefik.docker.network=${NETWORK_NAME:-kompose}'
networks:
kompose_network:
name: ${NETWORK_NAME:-kompose}

View File

@@ -1,11 +0,0 @@
http {
server {
listen 80 default_server;
root /usr/share/nginx/html;
location / {
try_files $uri $uri/ /index.html;
}
}
}