Skip to content

Commit 98ea989

Browse files
feat(docker compose)!: add docker compose instead of using a pre-build Dockerfile
1 parent 3ae85b6 commit 98ea989

5 files changed

Lines changed: 168 additions & 66 deletions

File tree

.github/workflows/publish.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build and Publish
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
tags: ["v*"]
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: docker/metadata-action@v5
19+
id: meta
20+
with:
21+
images: ghcr.io/deepanshkhurana/ode
22+
tags: |
23+
type=raw,value=latest,enable={{is_default_branch}}
24+
type=semver,pattern={{version}}
25+
type=semver,pattern={{major}}.{{minor}}
26+
27+
- uses: docker/login-action@v3
28+
with:
29+
registry: ghcr.io
30+
username: ${{ github.actor }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- uses: docker/build-push-action@v5
34+
with:
35+
context: .
36+
push: true
37+
tags: ${{ steps.meta.outputs.tags }}
38+
labels: ${{ steps.meta.outputs.labels }}

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.1.0] - 2025-11-26
9+
10+
### Added
11+
12+
- Major change since the app now moves to a `docker-compose.yaml` setup fundamentally changing how to write content in it. `README.md` will have more context but you can now mount directories for content (`pieces` and `pages`) while using the public image to constantly rebuild the site on push or update. You are free to set this up yourself. `config.yaml`, `intro.md`, and `favicon.ico` can also be mounted.
13+
814
## [1.0.3] - 2025-11-26
915

1016
### Added

Dockerfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
FROM node:20-alpine AS build
1+
FROM node:20-alpine
2+
23
WORKDIR /app
4+
35
COPY package*.json ./
4-
RUN npm install
6+
RUN npm ci
7+
58
COPY . .
6-
RUN npm run build
7-
FROM nginx:alpine
8-
COPY --from=build /app/dist /usr/share/nginx/html
9-
EXPOSE 80
10-
CMD ["nginx", "-g", "daemon off;"]
9+
10+
EXPOSE 4173
11+
CMD ["sh", "-c", "npm run build && npm run preview -- --host 0.0.0.0 --port 4173"]

README.md

Lines changed: 108 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ The theme/idea comes directly from `journal.coffee` which is my Wordpress-based
1010

1111
Rest assured, I will be using `ode` too!
1212

13+
## Warning
14+
15+
> [!WARNING]
16+
> Like all good things, Ode is currently changing and evolving. Things might break now and then.
17+
1318
## Live Demo
1419

1520
You can find a live demo of the app [here](https://ode-demo.vercel.app/).
@@ -64,87 +69,71 @@ https://github.com/user-attachments/assets/222af674-11f0-4b5a-8232-a31aca8a61b1
6469
- **Fully customizable**: All UI labels, site metadata, and page order configurable via `config.yaml`
6570
- **No tracking, no analytics, no boxes, no search, no media**: Just writing and reading
6671

67-
## Tech Stack
68-
69-
- **React 19** with React Router for client-side navigation
70-
- **Vite** for blazing fast development and optimized builds
71-
- **SCSS** for styling with a clean, minimal design
72-
- **TypeScript** build scripts for content indexing and generation
73-
- **ReactMarkdown** for rendering markdown content
74-
- **Front Matter** for parsing markdown metadata
75-
7672
## Getting Started
7773

78-
### Deployment Gotchas!
79-
80-
Once you have your Fork or branch ready, you can deploy the app but the reader position Permalinks as well as the Body of Work links will fail. This is due to SPA handling of paths and (from my understanding) how React works. But this can be fixed.
81-
82-
#### Easy Mode: Deploy to Vercel
74+
### Docker Compose (Recommended)
8375

84-
You can directly to Vercel below. `vercel.json` already has the fixes Vercel will need.
76+
If you want to self-host, use the public Docker image. Create a directory with your content:
8577

86-
https://github.com/DeepanshKhurana/ode/blob/46873b31df3d4b02bbb375d4389173a1b6ac3f6b/vercel.json#L1-L12
87-
88-
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FDeepanshKhurana%2Fode)
89-
90-
#### Pro Mode: nginx Configuration
91-
92-
If you are like me, you probably have your own server where you will need to handle SPA routing. If you are using nginx, a template is already provided.
93-
94-
https://github.com/DeepanshKhurana/ode/blob/81c9c2916c5fade480a017b277be7eb1dc799cb4/nginx-template#L1-L32
95-
96-
### From WordPress
78+
```
79+
my-site/
80+
public/
81+
config.yaml
82+
content/
83+
intro.md
84+
pieces/
85+
pages/
86+
docker-compose.yml
87+
```
9788

98-
If you are coming from WordPress, you can use the awesome [lonekorean/wordpress-export-to-markdown](https://github.com/lonekorean/wordpress-export-to-markdown) to get your content in markdown format. It will mostly be plug and play with this version of Ode.
89+
Create a `docker-compose.yml`:
90+
91+
```yaml
92+
services:
93+
ode:
94+
image: ghcr.io/deepanshkhurana/ode:latest
95+
ports:
96+
- "8080:4173"
97+
restart: unless-stopped
98+
volumes:
99+
- ./public:/app/public:ro
100+
```
99101
100-
### Installation
102+
Run:
101103
102104
```bash
103-
npm install
105+
docker compose up -d
104106
```
105107

106-
### Development
108+
Your site will be available at `http://localhost:8080`. Restart the container to rebuild after content changes:
107109

108110
```bash
109-
npm run dev
111+
docker compose restart
110112
```
111113

112-
Runs the app in development mode at `http://localhost:5173`
114+
### Other Deployment Options
113115

114-
### Building
116+
**Note:** In this case, you need to replace the content in `public/` with your own.
115117

116-
```bash
117-
npm run build
118-
```
118+
Once you have your Fork or branch ready, you can deploy the app but the reader position Permalinks as well as the Body of Work links will fail. This is due to SPA handling of paths and (from my understanding) how React works. But this can be fixed.
119119

120-
This will:
121-
1. Index all pieces from `public/content/pieces/`
122-
2. Index all pages from `public/content/pages/`
123-
3. Paginate pieces for reader mode
124-
4. Calculate word/piece statistics
125-
5. Generate RSS feed
126-
6. Generate body of work archive
127-
7. Build the production bundle
120+
#### Deploy to Vercel
128121

129-
### Preview Production Build
122+
You can directly to Vercel below. `vercel.json` already has the fixes Vercel will need.
130123

131-
```bash
132-
npm run preview
133-
```
124+
https://github.com/DeepanshKhurana/ode/blob/46873b31df3d4b02bbb375d4389173a1b6ac3f6b/vercel.json#L1-L12
134125

135-
## Configuration
126+
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FDeepanshKhurana%2Fode)
136127

137-
Edit `public/config.yaml` to customize your site. You can handle quite a few things here:
128+
#### nginx Configuration
138129

139-
- Change your site’s name, author, and vibe at the top.
140-
- Tweak button text and messages to sound how you want.
141-
- Pick which pages show up first in the menu.
142-
- Hide any pages or pieces you don’t want public.
143-
- Set how collections are sorted—oldest first or newest first.
144-
- Rename the light/dark mode switches.
145-
- Edit the “words wasted” summary to your liking.
130+
If you are like me, you probably have your own server where you will need to handle SPA routing. If you are using nginx, a template is already provided.
146131

147-
https://github.com/DeepanshKhurana/ode/blob/2e61bbe7eadcc36ff9b05c13e4e4d71ab4c885b1/public/config.yaml#L1-L41
132+
https://github.com/DeepanshKhurana/ode/blob/81c9c2916c5fade480a017b277be7eb1dc799cb4/nginx-template#L1-L32
133+
134+
### From WordPress
135+
136+
If you are coming from WordPress, you can use the awesome [lonekorean/wordpress-export-to-markdown](https://github.com/lonekorean/wordpress-export-to-markdown) to get your content in markdown format. It will mostly be plug and play with this version of Ode.
148137

149138
## Writing Content
150139

@@ -179,7 +168,58 @@ date: 2021-06-14
179168
Tell everyone everything!
180169
```
181170

182-
## Build Scripts
171+
## Configuration
172+
173+
Edit `public/config.yaml` to customize your site. You can handle quite a few things here:
174+
175+
- Change your site's name, author, and vibe at the top.
176+
- Tweak button text and messages to sound how you want.
177+
- Pick which pages show up first in the menu.
178+
- Hide any pages or pieces you don't want public.
179+
- Set how collections are sorted—oldest first or newest first.
180+
- Rename the light/dark mode switches.
181+
- Edit the "words wasted" summary to your liking.
182+
183+
https://github.com/DeepanshKhurana/ode/blob/2e61bbe7eadcc36ff9b05c13e4e4d71ab4c885b1/public/config.yaml#L1-L41
184+
185+
## Development
186+
187+
### Installation
188+
189+
```bash
190+
npm install
191+
```
192+
193+
### Dev Server
194+
195+
```bash
196+
npm run dev
197+
```
198+
199+
Runs the app in development mode at `http://localhost:5173`
200+
201+
### Building
202+
203+
```bash
204+
npm run build
205+
```
206+
207+
This will:
208+
1. Index all pieces from `public/content/pieces/`
209+
2. Index all pages from `public/content/pages/`
210+
3. Paginate pieces for reader mode
211+
4. Calculate word/piece statistics
212+
5. Generate RSS feed
213+
6. Generate body of work archive
214+
7. Build the production bundle
215+
216+
### Preview Production Build
217+
218+
```bash
219+
npm run preview
220+
```
221+
222+
### Build Scripts
183223

184224
Run individual build scripts:
185225

@@ -190,6 +230,15 @@ Run individual build scripts:
190230
- `npm run build:rss` - Generate RSS feed
191231
- `npm run build:sitemap` - Generate Sitemap
192232

233+
## Tech Stack
234+
235+
- **React 19** with React Router for client-side navigation
236+
- **Vite** for blazing fast development and optimized builds
237+
- **SCSS** for styling with a clean, minimal design
238+
- **TypeScript** build scripts for content indexing and generation
239+
- **ReactMarkdown** for rendering markdown content
240+
- **Front Matter** for parsing markdown metadata
241+
193242
## License
194243

195244
MIT

docker-compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
services:
2+
ode:
3+
image: ghcr.io/deepanshkhurana/ode:latest
4+
ports:
5+
- "8080:4173"
6+
restart: unless-stopped
7+
volumes:
8+
- ./public:/app/public:ro

0 commit comments

Comments
 (0)