deploy: Docker + site URL notebook.any.me.uk
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
FROM node:22-bookworm-slim AS build
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:1.27-alpine
|
||||
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
EXPOSE 80
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
||||
CMD wget -q -O /dev/null http://127.0.0.1/ || exit 1
|
||||
+1
-1
@@ -9,7 +9,7 @@ import { remarkObsidian } from './src/plugins/remark-obsidian.mjs';
|
||||
// https://astro.build/config
|
||||
// Astro 7 默认 Sätteri 不跑 remark 插件;笔记博客需要 [[wikilink]],改用 unified
|
||||
export default defineConfig({
|
||||
site: 'https://example.com',
|
||||
site: 'https://notebook.any.me.uk',
|
||||
integrations: [mdx(), sitemap()],
|
||||
markdown: {
|
||||
processor: unified({
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
name: notebook
|
||||
|
||||
services:
|
||||
notebook:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: harbor.any.me.uk/library/notebook:latest
|
||||
container_name: notebook
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "127.0.0.1:3030:80"
|
||||
@@ -0,0 +1,21 @@
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
# Astro static: pretty URLs with trailing directories
|
||||
location / {
|
||||
try_files $uri $uri/ $uri.html /index.html;
|
||||
}
|
||||
|
||||
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ {
|
||||
expires 7d;
|
||||
add_header Cache-Control "public, max-age=604800";
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
gzip on;
|
||||
gzip_types text/css application/javascript application/json image/svg+xml;
|
||||
}
|
||||
+1
-1
@@ -4,7 +4,7 @@ export const SITE_DESCRIPTION = '用 Obsidian 写作,用 Astro 发布的个人
|
||||
export const SITE_AUTHOR = '你的名字';
|
||||
|
||||
/** 部署域名,构建 RSS / sitemap 会用到(不要带 https://) */
|
||||
export const SITE_URL = 'https://example.com';
|
||||
export const SITE_URL = 'https://notebook.any.me.uk';
|
||||
|
||||
/**
|
||||
* Obsidian 库路径(给 scripts/sync-vault.mjs 用)
|
||||
|
||||
Reference in New Issue
Block a user