Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.git
.github
*.md
LICENSE
wrangler.jsonc
docker-compose.yml
Dockerfile
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Use the lightweight Nginx Alpine image
FROM nginx:alpine

# Copy custom nginx config
COPY ./nginx.conf /etc/nginx/conf.d/default.conf

# Copy static assets
COPY ./index.html /usr/share/nginx/html/index.html
COPY ./styles.css /usr/share/nginx/html/styles.css
COPY ./js /usr/share/nginx/html/js

# Healthcheck
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --quiet --tries=1 --spider http://localhost/ || exit 1

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ or
python -m http.server
```

With Docker:

```
docker compose up
```

Your data stays in your browser's local storage.

## Stack
Expand Down
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
services:
subgrid:
build: .
container_name: subgrid
ports:
- "8080:80"
restart: unless-stopped
22 changes: 22 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;

# Gzip compression
gzip on;
gzip_types text/css application/javascript;
gzip_min_length 1000;

# Cache static assets
location ~* \.(css|js)$ {
expires 7d;
add_header Cache-Control "public, immutable";
}

# Serve index.html for all routes (SPA fallback)
location / {
try_files $uri $uri/ /index.html;
}
}