Skip to content

Commit

Permalink
feat(docs): update Docker script and update Astro dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
codybrom committed Jan 10, 2025
1 parent f5e738d commit abba44d
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.DS_Store
node_modules
dist
9 changes: 9 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"recommendations": [
"codybrom.gpt-context-generator",
"DavidAnson.vscode-markdownlint",
"streetsidesoftware.code-spell-checker",
"vknabel.vscode-apple-swift-format",
"astro-build.astro-vscode"
]
}
17 changes: 11 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
services:
jekyll:
image: jekyll/jekyll:4.2.0
command: jekyll serve --force_polling --livereload
astro:
build:
context: ./docs
dockerfile: Dockerfile
ports:
- "4000:4000"
- "35729:35729"
- "4321:4321"
volumes:
- "./docs:/srv/jekyll"
- "./docs:/app"
- "/app/node_modules"
environment:
- NODE_ENV=development
- HOST=0.0.0.0
- PORT=4321
14 changes: 14 additions & 0 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:lts AS base
WORKDIR /app

# Copy package files
COPY package.json package-lock.json ./

# Development dependencies installation for dev server
RUN npm install

# Copy source
COPY . .

# Development command
CMD ["npm", "run", "dev", "--", "--host"]
11 changes: 1 addition & 10 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
// @ts-check
import { defineConfig } from "astro/config";
import tailwind from "@astrojs/tailwind";

import playformCompress from "@playform/compress";

// https://astro.build/config
export default defineConfig({
integrations: [tailwind(), playformCompress()],
site: "https://blankie.rest",
server: {
headers: {
// Set cache-control headers for all static assets
"/*.{js,css,jpg,jpeg,png,gif,ico,svg,webp,mp4}":
"Cache-Control: public, max-age=31536000, immutable", // 1 year cache
// Specific headers for HTML files
"/*.html": "Cache-Control: public, max-age=3600", // 1 hour cache
},
},
output: "static",
});
12 changes: 8 additions & 4 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dependencies": {
"@astrojs/tailwind": "^5.1.4",
"@playform/compress": "^0.1.7",
"astro": "^5.1.3",
"astro": "^5.1.5",
"astro-seo": "^0.8.4",
"tailwindcss": "^3.4.17"
},
Expand Down

0 comments on commit abba44d

Please sign in to comment.