Skip to content

Instantly share code, notes, and snippets.

@adampielak
Forked from williamzujkowski/ai-docker-compose.yml
Created December 3, 2025 12:09
Show Gist options
  • Select an option

  • Save adampielak/3ca2bbc0d71a0958fee8bb75cda45ed7 to your computer and use it in GitHub Desktop.

Select an option

Save adampielak/3ca2bbc0d71a0958fee8bb75cda45ed7 to your computer and use it in GitHub Desktop.
Docker Compose configuration for isolated AI experiment environment with network isolation and resource limits
# Docker Compose for isolated AI environment
# Provides network isolation and resource limits for AI experiments
services:
ai-sandbox:
image: pytorch/pytorch:latest
container_name: ai-experiment
networks:
- ai-isolated
volumes:
- ./models:/workspace/models:ro
- ./data:/workspace/data
environment:
- CUDA_VISIBLE_DEVICES=0
deploy:
resources:
limits:
cpus: '4'
memory: 16G
security_opt:
- no-new-privileges:true
read_only: true
tmpfs:
- /tmp
networks:
ai-isolated:
driver: bridge
internal: true # No external network access
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment