Skip to content

Commit f823b80

Browse files
committed
commit it all for real?
1 parent d252182 commit f823b80

8 files changed

Lines changed: 50 additions & 12 deletions

File tree

Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,15 @@ COPY requirements.txt .
6464
RUN pip install --no-cache-dir -r requirements.txt
6565

6666
# Copy Flask app and API
67-
COPY app.py .
68-
COPY api/ ./api/
67+
COPY server/ ./server/
6968

7069
# Copy generated static site from builder (includes esbuild assets)
7170
COPY --from=builder /app/static-build ./static-build
7271

73-
ENV STATIC_BUILD_DIR=static-build
72+
ENV STATIC_BUILD_DIR=/app/static-build
7473

7574
# Expose port 80
7675
EXPOSE 80
7776

7877
# Start gunicorn
79-
CMD ["gunicorn", "--bind", "0.0.0.0:80", "app:app"]
78+
CMD ["gunicorn", "--bind", "0.0.0.0:80", "--chdir", "/app/server", "app:app"]

Dockerfile.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Development static builder - builds everything at runtime in a loop
2-
FROM python:3.12-slim
2+
FROM python:3.14-slim
33

44
WORKDIR /app
55

Dockerfile.web

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ WORKDIR /app
55
COPY requirements.txt .
66
RUN pip install --no-cache-dir -r requirements.txt
77

8-
COPY app.py .
9-
COPY api/ ./api/
8+
COPY server/ ./server/
109

11-
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--reload", "app:app"]
10+
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--reload", "--access-logfile", "-", "--chdir", "/app/server", "app:app"]
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
layout: page
3+
title: Planar Systems
4+
---
5+
6+
Here we'll talk about both linear and nonlinear planar systems of the form
7+
8+
$$ \begin{aligned}
9+
\dot{x} & = f(x,y) \\
10+
\dot{y} & = g(x,y).
11+
\end{aligned}
12+
$$
13+
14+
:::definition "Separatrix"
15+
A **separatrix** is the boundary that separating two modes of behavior in a dynamical system.
16+
:::
17+
18+
:::definition "Homoclinic Orbit"
19+
Trajectories that start and end at the same @fixed-point are called **homoclinic orbits.**
20+
:::
21+
22+
:::definition "Heteroclinc Trajectory"
23+
Trajectories that connect two @fixed-point are called **heteroclinic orbits.**
24+
:::
25+
26+
:::definition "Hyperbolic Fixed Point"
27+
A **hyperbolic fixed point** is a @fixed-point for which the real part of both eigenvalues is non-zero.
28+
:::

docker-compose.dev.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ services:
2222
- "5000:5000"
2323
volumes:
2424
- static-build:/app/static-build:ro
25-
- ./app.py:/app/app.py:ro
26-
- ./api:/app/api:ro
25+
- ./server:/app/server
2726
environment:
28-
- STATIC_BUILD_DIR=static-build/website
27+
- STATIC_BUILD_DIR=/app/static-build/website
2928
container_name: web-dev
3029
restart: unless-stopped
3130
depends_on:

scripts/watch_and_build.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ def build_site(output_dir: str, builder: SiteBuilder = None) -> SiteBuilder:
8787
logger.info("Reusing SiteBuilder, clearing caches...")
8888
# Clear navigation cache (will be rebuilt quickly)
8989
clear_navigation_cache()
90+
# Rebuild URL mappings (required for new/moved/deleted files)
91+
builder.url_mapper.build_url_mappings()
9092
# Rebuild block index (required - rendered HTML is stored here)
9193
builder.block_index.build_index()
9294
# Clear page specs cache so specs are recomputed
File renamed without changes.

app.py renamed to server/app.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from flask import Flask, send_from_directory
1+
# Dev server for mathnotes
2+
from flask import Flask, send_from_directory, send_file
23
from pathlib import Path
34
import os
45

@@ -10,6 +11,16 @@
1011

1112
# Static file serving
1213
STATIC_BUILD = Path(os.environ.get('STATIC_BUILD_DIR', 'static-build'))
14+
# Timestamp file is one level up from website dir (survives clean)
15+
TIMESTAMP_FILE = STATIC_BUILD.parent / 'rebuild-timestamp.txt'
16+
17+
18+
@app.route('/rebuild-timestamp.txt')
19+
def rebuild_timestamp():
20+
"""Serve the rebuild timestamp for dev auto-reload."""
21+
if TIMESTAMP_FILE.exists():
22+
return send_file(TIMESTAMP_FILE, mimetype='text/plain')
23+
return '', 404
1324

1425

1526
@app.route('/', defaults={'path': ''})

0 commit comments

Comments
 (0)