first pass

This commit is contained in:
2026-01-26 22:33:55 -06:00
commit fe66be4aad
37 changed files with 3127 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
bin
obj
.git
.gitignore
.env
.env.local
*.tar
*.tar.gz
# IDE
.vs
.vscode
.idea
*.user
*.suo
# Build
publish
# Documentation
README.md
README.DOCKER.md
docs
# Docker files
Dockerfile
docker-compose.yml
.dockerignore
docker-deployment.json
*.ps1
# Logs
*.log
logs

View File

@@ -0,0 +1,28 @@
# Stage 1: Build
FROM mcr.microsoft.com/dotnet/sdk:{{DOTNET_VERSION}} AS build
WORKDIR /src
# Copy project file and restore
COPY ["{{CSPROJ_FILE}}", "./"]
RUN dotnet restore "{{CSPROJ_FILE}}"
# Copy everything else and build
COPY . .
RUN dotnet build "{{CSPROJ_FILE}}" -c Release -o /app/build
RUN dotnet publish "{{CSPROJ_FILE}}" -c Release -o /app/publish
# Stage 2: Runtime
FROM mcr.microsoft.com/dotnet/aspnet:{{DOTNET_VERSION}}
WORKDIR /app
COPY --from=build /app/publish .
# Set environment
ENV ASPNETCORE_URLS=http://+:{{PORT}}
ENV ASPNETCORE_ENVIRONMENT=Production
EXPOSE {{PORT}}
ENTRYPOINT ["dotnet", "{{DLL_NAME}}"]

View File

@@ -0,0 +1,20 @@
services:
{{PROJECT_NAME}}:
build: .
container_name: {{PROJECT_NAME}}
restart: unless-stopped
ports:
- "${HOST_PORT:-{{PORT}}}:{{PORT}}"
{{#if USE_ENV_FILE}}
env_file:
- .env
{{/if}}
environment:
ASPNETCORE_ENVIRONMENT: Production
ASPNETCORE_URLS: http://+:{{PORT}}
{{#if HAS_VOLUMES}}
volumes:
{{#each VOLUMES}}
- {{this}}
{{/each}}
{{/if}}

View File

@@ -0,0 +1,47 @@
node_modules
npm-debug.log*
.git
.gitignore
.env
.env.local
.env.*.local
*.tar
*.tar.gz
# IDE
.vscode
.idea
*.swp
*.swo
# Test & Coverage
coverage
.nyc_output
*.test.js
*.spec.js
__tests__
# Build artifacts
dist
build
# Documentation
README.md
README.DOCKER.md
CHANGELOG.md
docs
# Docker files (don't include in image)
Dockerfile
docker-compose.yml
docker-compose.yaml
.dockerignore
docker-deployment.json
# Scripts
*.ps1
*.sh
# Logs
logs
*.log

View File

@@ -0,0 +1,27 @@
FROM node:{{NODE_VERSION}}-slim
WORKDIR /app
# Copy package files first for better caching
COPY package.json package-lock.json* ./
# Install production dependencies only
RUN npm ci --omit=dev
# Copy application source
COPY . .
# Set environment
ENV NODE_ENV=production
ENV PORT={{PORT}}
{{#if BUILD_COMMAND}}
# Build application
RUN {{BUILD_COMMAND}}
{{/if}}
# Expose port
EXPOSE {{PORT}}
# Start application
CMD ["node", "{{ENTRY_POINT}}"]

View File

@@ -0,0 +1,24 @@
services:
{{PROJECT_NAME}}:
build: .
container_name: {{PROJECT_NAME}}
restart: unless-stopped
ports:
- "${HOST_PORT:-{{PORT}}}:{{PORT}}"
{{#if USE_ENV_FILE}}
env_file:
- .env
{{/if}}
environment:
NODE_ENV: production
PORT: {{PORT}}
{{#if HAS_VOLUMES}}
volumes:
{{#each VOLUMES}}
- {{this}}
{{/each}}
{{/if}}
{{#if EXTRA_HOSTS}}
extra_hosts:
- "host.docker.internal:host-gateway"
{{/if}}

View File

@@ -0,0 +1,32 @@
node_modules
npm-debug.log*
.git
.gitignore
.env
.env.local
.env.*.local
*.tar
*.tar.gz
# IDE
.vscode
.idea
# Test & Coverage
coverage
.nyc_output
# Build output (built during docker build)
dist
# Documentation
README.md
README.DOCKER.md
docs
# Docker files
Dockerfile
docker-compose.yml
.dockerignore
docker-deployment.json
*.ps1

View File

@@ -0,0 +1,34 @@
# Stage 1: Build
FROM node:{{NODE_VERSION}}-alpine AS builder
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci
COPY . .
RUN npm run build
# Stage 2: Production
FROM node:{{NODE_VERSION}}-alpine
WORKDIR /app
# Copy package files and install production dependencies
COPY package.json package-lock.json* ./
RUN npm ci --omit=dev
# Copy built files from builder
COPY --from=builder /app/dist ./dist
# Copy server file
COPY server.mjs ./server.mjs
# Set environment
ENV NODE_ENV=production
ENV PORT={{PORT}}
ENV DIST_DIR=/app/dist
EXPOSE {{PORT}}
CMD ["node", "server.mjs"]

View File

@@ -0,0 +1,24 @@
services:
{{PROJECT_NAME}}:
build: .
container_name: {{PROJECT_NAME}}
restart: unless-stopped
ports:
- "${HOST_PORT:-{{PORT}}}:{{PORT}}"
{{#if USE_ENV_FILE}}
env_file:
- .env
{{/if}}
environment:
NODE_ENV: production
PORT: {{PORT}}
{{#if HAS_VOLUMES}}
volumes:
{{#each VOLUMES}}
- {{this}}
{{/each}}
{{/if}}
{{#if EXTRA_HOSTS}}
extra_hosts:
- "host.docker.internal:host-gateway"
{{/if}}

View File

@@ -0,0 +1,32 @@
node_modules
npm-debug.log*
.git
.gitignore
.env
.env.local
.env.*.local
*.tar
*.tar.gz
# IDE
.vscode
.idea
# Test & Coverage
coverage
.nyc_output
# Build output (built during docker build)
dist
# Documentation
README.md
README.DOCKER.md
docs
# Docker files
Dockerfile
docker-compose.yml
.dockerignore
docker-deployment.json
*.ps1

View File

@@ -0,0 +1,23 @@
# Stage 1: Build
FROM node:{{NODE_VERSION}}-alpine AS builder
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci
COPY . .
RUN npm run build
# Stage 2: Production (Nginx)
FROM nginx:alpine
# Copy built files
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

View File

@@ -0,0 +1,13 @@
services:
{{PROJECT_NAME}}:
build: .
container_name: {{PROJECT_NAME}}
restart: unless-stopped
ports:
- "${HOST_PORT:-80}:80"
{{#if HAS_VOLUMES}}
volumes:
{{#each VOLUMES}}
- {{this}}
{{/each}}
{{/if}}

View File

@@ -0,0 +1,25 @@
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
# Handle client-side routing
location / {
try_files $uri $uri/ /index.html;
}
# Cache static assets
location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff|woff2|ttf|eot)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# Gzip compression
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
}

View File

@@ -0,0 +1,49 @@
__pycache__
*.pyc
*.pyo
*.pyd
.Python
.git
.gitignore
.env
.env.local
*.tar
*.tar.gz
# Virtual environments
venv
.venv
env
# IDE
.vscode
.idea
# Test
.pytest_cache
.coverage
# ML artifacts (large files)
*.pt
*.pth
*.onnx
*.h5
*.pkl
models/
checkpoints/
weights/
# Data (mount as volume instead)
data/
datasets/
# Docker files
Dockerfile
docker-compose.yml
.dockerignore
docker-deployment.json
*.ps1
# Logs
*.log
logs

View File

@@ -0,0 +1,27 @@
FROM python:{{PYTHON_VERSION}}-slim
# Install system dependencies for ML libraries
RUN apt-get update && apt-get install -y --no-install-recommends \
libsndfile1 \
ffmpeg \
libavcodec-extra \
libgl1-mesa-glx \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application
COPY . .
# Set environment
ENV PYTHONUNBUFFERED=1
ENV PORT={{PORT}}
EXPOSE {{PORT}}
CMD ["python", "{{ENTRY_POINT}}"]

View File

@@ -0,0 +1,28 @@
services:
{{PROJECT_NAME}}:
build: .
container_name: {{PROJECT_NAME}}
restart: unless-stopped
ports:
- "${HOST_PORT:-{{PORT}}}:{{PORT}}"
{{#if USE_ENV_FILE}}
env_file:
- .env
{{/if}}
environment:
PYTHONUNBUFFERED: 1
PORT: {{PORT}}
{{#if HAS_VOLUMES}}
volumes:
{{#each VOLUMES}}
- {{this}}
{{/each}}
{{/if}}
# Uncomment below for GPU support
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: 1
# capabilities: [gpu]

View File

@@ -0,0 +1,44 @@
__pycache__
*.pyc
*.pyo
*.pyd
.Python
.git
.gitignore
.env
.env.local
*.tar
*.tar.gz
# Virtual environments
venv
.venv
env
ENV
# IDE
.vscode
.idea
*.swp
# Test & Coverage
.pytest_cache
.coverage
htmlcov
.tox
# Documentation
README.md
README.DOCKER.md
docs
# Docker files
Dockerfile
docker-compose.yml
.dockerignore
docker-deployment.json
*.ps1
# Logs
*.log
logs

View File

@@ -0,0 +1,18 @@
FROM python:{{PYTHON_VERSION}}-slim
WORKDIR /app
# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application
COPY . .
# Set environment
ENV PYTHONUNBUFFERED=1
ENV PORT={{PORT}}
EXPOSE {{PORT}}
CMD ["python", "{{ENTRY_POINT}}"]

View File

@@ -0,0 +1,20 @@
services:
{{PROJECT_NAME}}:
build: .
container_name: {{PROJECT_NAME}}
restart: unless-stopped
ports:
- "${HOST_PORT:-{{PORT}}}:{{PORT}}"
{{#if USE_ENV_FILE}}
env_file:
- .env
{{/if}}
environment:
PYTHONUNBUFFERED: 1
PORT: {{PORT}}
{{#if HAS_VOLUMES}}
volumes:
{{#each VOLUMES}}
- {{this}}
{{/each}}
{{/if}}

View File

@@ -0,0 +1,24 @@
.git
.gitignore
.env
.env.local
*.tar
*.tar.gz
# IDE
.vscode
.idea
# Documentation (keep README.md for the site if needed)
README.DOCKER.md
docs
# Docker files
Dockerfile
docker-compose.yml
.dockerignore
docker-deployment.json
*.ps1
# Logs
*.log

View File

@@ -0,0 +1,19 @@
FROM nginx:alpine
# Copy static files
COPY . /usr/share/nginx/html
# Copy nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Remove Docker-related files from the served directory
RUN rm -f /usr/share/nginx/html/Dockerfile \
/usr/share/nginx/html/docker-compose.yml \
/usr/share/nginx/html/.dockerignore \
/usr/share/nginx/html/docker-deployment.json \
/usr/share/nginx/html/*.ps1 \
/usr/share/nginx/html/README.DOCKER.md 2>/dev/null || true
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

View File

@@ -0,0 +1,13 @@
services:
{{PROJECT_NAME}}:
build: .
container_name: {{PROJECT_NAME}}
restart: unless-stopped
ports:
- "${HOST_PORT:-80}:80"
{{#if HAS_VOLUMES}}
volumes:
{{#each VOLUMES}}
- {{this}}
{{/each}}
{{/if}}

View File

@@ -0,0 +1,42 @@
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html index.htm;
# Handle SPA routing (fallback to index.html)
location / {
try_files $uri $uri/ /index.html;
}
# PHP handling (if PHP files exist)
location ~ \.php$ {
# Uncomment below if using PHP-FPM
# fastcgi_pass php:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# include fastcgi_params;
# For static sites without PHP, return 404
return 404;
}
# Cache static assets
location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff|woff2|ttf|eot|pdf)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
# Gzip compression
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
}