-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (40 loc) · 1.17 KB
/
Dockerfile
File metadata and controls
47 lines (40 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Two Generals Protocol - Interactive Visualizer & Paper
# Build: docker build -t riffcc/two-generals:latest .
# Run: docker run -p 8080:80 riffcc/two-generals:latest
FROM nginx:alpine
# Copy web visualizer (pre-built dist)
COPY web/dist/ /usr/share/nginx/html/
# Copy paper
COPY paper/main.pdf /usr/share/nginx/html/paper/main.pdf
# Copy Lean 4 source files for exploration
COPY lean4/*.lean /usr/share/nginx/html/lean4/
COPY lean4/lakefile.lean /usr/share/nginx/html/lean4/
COPY lean4/lean-toolchain /usr/share/nginx/html/lean4/
# Custom nginx config to serve .lean files with proper MIME type
RUN echo 'server { \
listen 80; \
server_name localhost; \
root /usr/share/nginx/html; \
index index.html; \
\
location / { \
try_files $uri $uri/ /index.html; \
} \
\
location = /paper { \
return 301 /paper/main.pdf; \
} \
\
location /paper/ { \
add_header Content-Disposition "inline"; \
} \
\
location /lean4/ { \
types { \
text/plain lean; \
} \
add_header Content-Type text/plain; \
} \
}' > /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]