first pass
This commit is contained in:
49
templates/python/ml-pytorch/.dockerignore.template
Normal file
49
templates/python/ml-pytorch/.dockerignore.template
Normal 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
|
||||
27
templates/python/ml-pytorch/Dockerfile.template
Normal file
27
templates/python/ml-pytorch/Dockerfile.template
Normal 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}}"]
|
||||
28
templates/python/ml-pytorch/docker-compose.yml.template
Normal file
28
templates/python/ml-pytorch/docker-compose.yml.template
Normal 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]
|
||||
44
templates/python/standard/.dockerignore.template
Normal file
44
templates/python/standard/.dockerignore.template
Normal 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
|
||||
18
templates/python/standard/Dockerfile.template
Normal file
18
templates/python/standard/Dockerfile.template
Normal 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}}"]
|
||||
20
templates/python/standard/docker-compose.yml.template
Normal file
20
templates/python/standard/docker-compose.yml.template
Normal 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}}
|
||||
Reference in New Issue
Block a user