File tree Expand file tree Collapse file tree 5 files changed +61
-5
lines changed
Expand file tree Collapse file tree 5 files changed +61
-5
lines changed Original file line number Diff line number Diff line change 1+ .git
2+ cli
3+ docs
4+ CLAUDE.md
5+ LICENSE
6+ README.md
7+ Makefile
8+ Dockerfile
9+ .dockerignore
10+ .github
Original file line number Diff line number Diff line change 1+ FROM nginx:alpine
2+
3+ COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
4+ COPY --chmod=644 web/ /usr/share/nginx/html/
5+
6+ EXPOSE 8000
Original file line number Diff line number Diff line change 11# Makefile for EPUB to XTC Converter & Optimizer
22
3- .PHONY : all serve tag help
3+ .PHONY : all serve docker-serve tag help
4+
5+ PORT ?= 8000
46
57# Default target
68all : help
@@ -11,6 +13,11 @@ serve: ## Run local web server (http://localhost:8000)
1113 @echo " Starting server at http://localhost:8000"
1214 @cd web && python3 -m http.server 8000
1315
16+ docker-serve : # # Run in Docker (Ctrl+C to stop). Usage: make docker-serve [PORT=8000]
17+ @docker build -t epub-to-xtc .
18+ @echo " Running at http://localhost:$( PORT) (Ctrl+C to stop)"
19+ @docker run --rm -p $(PORT ) :8000 epub-to-xtc
20+
1421# # Release:
1522
1623tag : # # Create and push a version tag (triggers GitHub release)
Original file line number Diff line number Diff line change @@ -125,16 +125,20 @@ Clone the repository and serve the web directory:
125125
126126``` bash
127127git clone https://github.com/bigbag/epub-optimizer-xteink.git
128- cd epub-optimizer-xteink/web
128+ cd epub-optimizer-xteink
129+
130+ # Using Docker
131+ make docker-serve # http://localhost:8000
132+ make docker-serve PORT=3000 # custom port
129133
130134# Using Python
131- python -m http.server 8000
135+ cd web && python -m http.server 8000
132136
133137# Using Node.js
134- npx serve .
138+ cd web && npx serve .
135139
136140# Using PHP
137- php -S localhost:8000
141+ cd web && php -S localhost:8000
138142```
139143
140144Then open http://localhost:8000 in your browser.
Original file line number Diff line number Diff line change 1+ server {
2+ listen 8000 ;
3+ server_name localhost;
4+ root /usr/share/nginx/html;
5+ index index .html;
6+
7+ types {
8+ text/html html htm;
9+ text/css css;
10+ application/javascript js;
11+ application/json json;
12+ application/wasm wasm;
13+ image/png png;
14+ image/jpeg jpg jpeg;
15+ image/svg+xml svg;
16+ image/x-icon ico;
17+ font/woff2 woff2;
18+ font/woff woff;
19+ font/ttf ttf;
20+ application/octet-stream bin;
21+ }
22+
23+ gzip on;
24+ gzip_types text/css application/javascript application/json application/wasm image/svg+xml;
25+
26+ location / {
27+ try_files $uri $uri / =404 ;
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments