refactor: Use separate .env.modern and .env.legacy files

- Remove base-legacy.yml and base-modern.yml (YAML anchors don't work with include)
- Make all compose files self-contained
- Add .env.modern (8G RAM, 4 CPU) for Win 10/11, Server 2016+
- Add .env.legacy (2G RAM, 2 CPU) for older systems
- Update README and .env.example documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Michel Abboud 2026-01-28 23:44:10 +00:00
parent 620cda9282
commit c27837738d
22 changed files with 291 additions and 212 deletions

View File

@ -1,40 +1,24 @@
# Windows Docker VM Configuration # Windows Docker VM Configuration
# Copy this file to .env and customize #
# Two env files are provided with optimized defaults:
# =========================================== # - .env.modern (8G RAM, 4 CPU) - Windows 10/11, Server 2016+
# MODERN SYSTEMS (Windows 10/11, Server 2016+) # - .env.legacy (2G RAM, 2 CPU) - Windows 7/8, Vista, XP, 2000, Server 2003-2012, Tiny
# =========================================== #
MODERN_RAM_SIZE=8G # Each compose file references the appropriate env file automatically.
MODERN_CPU_CORES=4 # Edit .env.modern or .env.legacy to customize settings.
MODERN_DISK_SIZE=128G #
# Available settings:
# =========================================== #
# LEGACY SYSTEMS (Windows 7/8, Vista, XP, 2000, Server 2003-2012) # RAM_SIZE=8G # Memory allocation
# =========================================== # CPU_CORES=4 # CPU cores
LEGACY_RAM_SIZE=2G # DISK_SIZE=128G # Virtual disk size
LEGACY_CPU_CORES=2 # USERNAME=Docker # Windows username
LEGACY_DISK_SIZE=32G # PASSWORD=admin # Windows password
# LANGUAGE=en # Installation language
# =========================================== # REGION=en-US # Region setting
# COMMON SETTINGS (applies to all) # KEYBOARD=en-US # Keyboard layout
# =========================================== # WIDTH=1280 # Display width
# HEIGHT=720 # Display height
# User Credentials # DHCP=N # Use DHCP (Y/N)
USERNAME=Docker # SAMBA=Y # Enable file sharing (Y/N)
PASSWORD=admin # DEBUG=N # Debug mode (Y/N)
# Language & Region
LANGUAGE=en
REGION=en-US
KEYBOARD=en-US
# Display
WIDTH=1280
HEIGHT=720
# Network
DHCP=N
SAMBA=Y
# Debug
DEBUG=N

26
.env.legacy Normal file
View File

@ -0,0 +1,26 @@
# Legacy Systems Configuration (Windows 7/8, Vista, XP, 2000, Server 2003-2012, Tiny)
# Resources
RAM_SIZE=2G
CPU_CORES=2
DISK_SIZE=32G
# User Credentials
USERNAME=Docker
PASSWORD=admin
# Language & Region
LANGUAGE=en
REGION=en-US
KEYBOARD=en-US
# Display
WIDTH=1280
HEIGHT=720
# Network
DHCP=N
SAMBA=Y
# Debug
DEBUG=N

26
.env.modern Normal file
View File

@ -0,0 +1,26 @@
# Modern Systems Configuration (Windows 10/11, Server 2016+)
# Resources
RAM_SIZE=8G
CPU_CORES=4
DISK_SIZE=128G
# User Credentials
USERNAME=Docker
PASSWORD=admin
# Language & Region
LANGUAGE=en
REGION=en-US
KEYBOARD=en-US
# Display
WIDTH=1280
HEIGHT=720
# Network
DHCP=N
SAMBA=Y
# Debug
DEBUG=N

View File

@ -1,23 +0,0 @@
x-legacy: &legacy
image: dockurr/windows
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
restart: unless-stopped
stop_grace_period: 2m
environment:
RAM_SIZE: ${LEGACY_RAM_SIZE:-2G}
CPU_CORES: ${LEGACY_CPU_CORES:-2}
DISK_SIZE: ${LEGACY_DISK_SIZE:-32G}
USERNAME: ${USERNAME:-Docker}
PASSWORD: ${PASSWORD:-admin}
LANGUAGE: ${LANGUAGE:-en}
REGION: ${REGION:-en-US}
KEYBOARD: ${KEYBOARD:-en-US}
WIDTH: ${WIDTH:-1280}
HEIGHT: ${HEIGHT:-720}
DHCP: ${DHCP:-N}
SAMBA: ${SAMBA:-Y}
DEBUG: ${DEBUG:-N}

View File

@ -1,23 +0,0 @@
x-modern: &modern
image: dockurr/windows
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
restart: unless-stopped
stop_grace_period: 2m
environment:
RAM_SIZE: ${MODERN_RAM_SIZE:-8G}
CPU_CORES: ${MODERN_CPU_CORES:-4}
DISK_SIZE: ${MODERN_DISK_SIZE:-128G}
USERNAME: ${USERNAME:-Docker}
PASSWORD: ${PASSWORD:-admin}
LANGUAGE: ${LANGUAGE:-en}
REGION: ${REGION:-en-US}
KEYBOARD: ${KEYBOARD:-en-US}
WIDTH: ${WIDTH:-1280}
HEIGHT: ${HEIGHT:-720}
DHCP: ${DHCP:-N}
SAMBA: ${SAMBA:-Y}
DEBUG: ${DEBUG:-N}

View File

@ -1,42 +1,60 @@
include:
- ../base-modern.yml
services: services:
win10: win10:
<<: *modern image: dockurr/windows
container_name: win10 container_name: win10
env_file: ../../.env env_file: ../../.env.modern
environment: environment:
VERSION: "10" VERSION: "10"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports: ports:
- 8010:8006 - 8010:8006
- 3310:3389/tcp - 3310:3389/tcp
- 3310:3389/udp - 3310:3389/udp
volumes: volumes:
- ../../data/win10:/storage - ../../data/win10:/storage
restart: unless-stopped
stop_grace_period: 2m
win10e: win10e:
<<: *modern image: dockurr/windows
container_name: win10e container_name: win10e
env_file: ../../.env env_file: ../../.env.modern
environment: environment:
VERSION: "10e" VERSION: "10e"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports: ports:
- 8014:8006 - 8014:8006
- 3314:3389/tcp - 3314:3389/tcp
- 3314:3389/udp - 3314:3389/udp
volumes: volumes:
- ../../data/win10e:/storage - ../../data/win10e:/storage
restart: unless-stopped
stop_grace_period: 2m
win10l: win10l:
<<: *modern image: dockurr/windows
container_name: win10l container_name: win10l
env_file: ../../.env env_file: ../../.env.modern
environment: environment:
VERSION: "10l" VERSION: "10l"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports: ports:
- 8015:8006 - 8015:8006
- 3315:3389/tcp - 3315:3389/tcp
- 3315:3389/udp - 3315:3389/udp
volumes: volumes:
- ../../data/win10l:/storage - ../../data/win10l:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,42 +1,60 @@
include:
- ../base-modern.yml
services: services:
win11: win11:
<<: *modern image: dockurr/windows
container_name: win11 container_name: win11
env_file: ../../.env env_file: ../../.env.modern
environment: environment:
VERSION: "11" VERSION: "11"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports: ports:
- 8011:8006 - 8011:8006
- 3311:3389/tcp - 3311:3389/tcp
- 3311:3389/udp - 3311:3389/udp
volumes: volumes:
- ../../data/win11:/storage - ../../data/win11:/storage
restart: unless-stopped
stop_grace_period: 2m
win11e: win11e:
<<: *modern image: dockurr/windows
container_name: win11e container_name: win11e
env_file: ../../.env env_file: ../../.env.modern
environment: environment:
VERSION: "11e" VERSION: "11e"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports: ports:
- 8012:8006 - 8012:8006
- 3312:3389/tcp - 3312:3389/tcp
- 3312:3389/udp - 3312:3389/udp
volumes: volumes:
- ../../data/win11e:/storage - ../../data/win11e:/storage
restart: unless-stopped
stop_grace_period: 2m
win11l: win11l:
<<: *modern image: dockurr/windows
container_name: win11l container_name: win11l
env_file: ../../.env env_file: ../../.env.modern
environment: environment:
VERSION: "11l" VERSION: "11l"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports: ports:
- 8013:8006 - 8013:8006
- 3313:3389/tcp - 3313:3389/tcp
- 3313:3389/udp - 3313:3389/udp
volumes: volumes:
- ../../data/win11l:/storage - ../../data/win11l:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,29 +1,40 @@
include:
- ../base-legacy.yml
services: services:
win7: win7:
<<: *legacy image: dockurr/windows
container_name: win7 container_name: win7
env_file: ../../.env env_file: ../../.env.legacy
environment: environment:
VERSION: "7u" VERSION: "7u"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports: ports:
- 8007:8006 - 8007:8006
- 3307:3389/tcp - 3307:3389/tcp
- 3307:3389/udp - 3307:3389/udp
volumes: volumes:
- ../../data/win7:/storage - ../../data/win7:/storage
restart: unless-stopped
stop_grace_period: 2m
win7e: win7e:
<<: *legacy image: dockurr/windows
container_name: win7e container_name: win7e
env_file: ../../.env env_file: ../../.env.legacy
environment: environment:
VERSION: "7e" VERSION: "7e"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports: ports:
- 8071:8006 - 8071:8006
- 3371:3389/tcp - 3371:3389/tcp
- 3371:3389/udp - 3371:3389/udp
volumes: volumes:
- ../../data/win7e:/storage - ../../data/win7e:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,29 +1,40 @@
include:
- ../base-legacy.yml
services: services:
win81: win81:
<<: *legacy image: dockurr/windows
container_name: win81 container_name: win81
env_file: ../../.env env_file: ../../.env.legacy
environment: environment:
VERSION: "8" VERSION: "8"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports: ports:
- 8008:8006 - 8008:8006
- 3308:3389/tcp - 3308:3389/tcp
- 3308:3389/udp - 3308:3389/udp
volumes: volumes:
- ../../data/win81:/storage - ../../data/win81:/storage
restart: unless-stopped
stop_grace_period: 2m
win81e: win81e:
<<: *legacy image: dockurr/windows
container_name: win81e container_name: win81e
env_file: ../../.env env_file: ../../.env.legacy
environment: environment:
VERSION: "8e" VERSION: "8e"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports: ports:
- 8081:8006 - 8081:8006
- 3381:3389/tcp - 3381:3389/tcp
- 3381:3389/udp - 3381:3389/udp
volumes: volumes:
- ../../data/win81e:/storage - ../../data/win81e:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,16 +1,20 @@
include:
- ../base-legacy.yml
services: services:
vista: vista:
<<: *legacy image: dockurr/windows
container_name: vista container_name: vista
env_file: ../../.env env_file: ../../.env.legacy
environment: environment:
VERSION: "vu" VERSION: "vu"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports: ports:
- 8006:8006 - 8006:8006
- 3306:3389/tcp - 3306:3389/tcp
- 3306:3389/udp - 3306:3389/udp
volumes: volumes:
- ../../data/vista:/storage - ../../data/vista:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,16 +1,20 @@
include:
- ../base-legacy.yml
services: services:
win2k: win2k:
<<: *legacy image: dockurr/windows
container_name: win2k container_name: win2k
env_file: ../../.env env_file: ../../.env.legacy
environment: environment:
VERSION: "2k" VERSION: "2k"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports: ports:
- 8000:8006 - 8000:8006
- 3300:3389/tcp - 3300:3389/tcp
- 3300:3389/udp - 3300:3389/udp
volumes: volumes:
- ../../data/win2k:/storage - ../../data/win2k:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,16 +1,20 @@
include:
- ../base-legacy.yml
services: services:
winxp: winxp:
<<: *legacy image: dockurr/windows
container_name: winxp container_name: winxp
env_file: ../../.env env_file: ../../.env.legacy
environment: environment:
VERSION: "xp" VERSION: "xp"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports: ports:
- 8005:8006 - 8005:8006
- 3305:3389/tcp - 3305:3389/tcp
- 3305:3389/udp - 3305:3389/udp
volumes: volumes:
- ../../data/winxp:/storage - ../../data/winxp:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,16 +1,20 @@
include:
- ../base-legacy.yml
services: services:
win2003: win2003:
<<: *legacy image: dockurr/windows
container_name: win2003 container_name: win2003
env_file: ../../.env env_file: ../../.env.legacy
environment: environment:
VERSION: "2003" VERSION: "2003"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports: ports:
- 8003:8006 - 8003:8006
- 3303:3389/tcp - 3303:3389/tcp
- 3303:3389/udp - 3303:3389/udp
volumes: volumes:
- ../../data/win2003:/storage - ../../data/win2003:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,16 +1,20 @@
include:
- ../base-legacy.yml
services: services:
win2008: win2008:
<<: *legacy image: dockurr/windows
container_name: win2008 container_name: win2008
env_file: ../../.env env_file: ../../.env.legacy
environment: environment:
VERSION: "2008" VERSION: "2008"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports: ports:
- 8108:8006 - 8108:8006
- 3208:3389/tcp - 3208:3389/tcp
- 3208:3389/udp - 3208:3389/udp
volumes: volumes:
- ../../data/win2008:/storage - ../../data/win2008:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,16 +1,20 @@
include:
- ../base-legacy.yml
services: services:
win2012: win2012:
<<: *legacy image: dockurr/windows
container_name: win2012 container_name: win2012
env_file: ../../.env env_file: ../../.env.legacy
environment: environment:
VERSION: "2012" VERSION: "2012"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports: ports:
- 8112:8006 - 8112:8006
- 3212:3389/tcp - 3212:3389/tcp
- 3212:3389/udp - 3212:3389/udp
volumes: volumes:
- ../../data/win2012:/storage - ../../data/win2012:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,16 +1,20 @@
include:
- ../base-modern.yml
services: services:
win2016: win2016:
<<: *modern image: dockurr/windows
container_name: win2016 container_name: win2016
env_file: ../../.env env_file: ../../.env.modern
environment: environment:
VERSION: "2016" VERSION: "2016"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports: ports:
- 8016:8006 - 8016:8006
- 3316:3389/tcp - 3316:3389/tcp
- 3316:3389/udp - 3316:3389/udp
volumes: volumes:
- ../../data/win2016:/storage - ../../data/win2016:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,16 +1,20 @@
include:
- ../base-modern.yml
services: services:
win2019: win2019:
<<: *modern image: dockurr/windows
container_name: win2019 container_name: win2019
env_file: ../../.env env_file: ../../.env.modern
environment: environment:
VERSION: "2019" VERSION: "2019"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports: ports:
- 8019:8006 - 8019:8006
- 3319:3389/tcp - 3319:3389/tcp
- 3319:3389/udp - 3319:3389/udp
volumes: volumes:
- ../../data/win2019:/storage - ../../data/win2019:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,16 +1,20 @@
include:
- ../base-modern.yml
services: services:
win2022: win2022:
<<: *modern image: dockurr/windows
container_name: win2022 container_name: win2022
env_file: ../../.env env_file: ../../.env.modern
environment: environment:
VERSION: "2022" VERSION: "2022"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports: ports:
- 8022:8006 - 8022:8006
- 3322:3389/tcp - 3322:3389/tcp
- 3322:3389/udp - 3322:3389/udp
volumes: volumes:
- ../../data/win2022:/storage - ../../data/win2022:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,16 +1,20 @@
include:
- ../base-modern.yml
services: services:
win2025: win2025:
<<: *modern image: dockurr/windows
container_name: win2025 container_name: win2025
env_file: ../../.env env_file: ../../.env.modern
environment: environment:
VERSION: "2025" VERSION: "2025"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports: ports:
- 8025:8006 - 8025:8006
- 3325:3389/tcp - 3325:3389/tcp
- 3325:3389/udp - 3325:3389/udp
volumes: volumes:
- ../../data/win2025:/storage - ../../data/win2025:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,16 +1,20 @@
include:
- ../base-legacy.yml
services: services:
tiny10: tiny10:
<<: *legacy image: dockurr/windows
container_name: tiny10 container_name: tiny10
env_file: ../../.env env_file: ../../.env.legacy
environment: environment:
VERSION: "tiny10" VERSION: "tiny10"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports: ports:
- 8110:8006 - 8110:8006
- 3110:3389/tcp - 3110:3389/tcp
- 3110:3389/udp - 3110:3389/udp
volumes: volumes:
- ../../data/tiny10:/storage - ../../data/tiny10:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,16 +1,20 @@
include:
- ../base-legacy.yml
services: services:
tiny11: tiny11:
<<: *legacy image: dockurr/windows
container_name: tiny11 container_name: tiny11
env_file: ../../.env env_file: ../../.env.legacy
environment: environment:
VERSION: "tiny11" VERSION: "tiny11"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports: ports:
- 8111:8006 - 8111:8006
- 3111:3389/tcp - 3111:3389/tcp
- 3111:3389/udp - 3111:3389/udp
volumes: volumes:
- ../../data/tiny11:/storage - ../../data/tiny11:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -112,39 +112,27 @@ Use `winctl.sh` for easy container management:
### Quick Start (Manual) ### Quick Start (Manual)
```bash ```bash
# Copy environment template
cp .env.example .env
# Run default (Windows 11)
docker compose up
# Run specific version # Run specific version
docker compose -f compose/desktop/win11.yml up win11 docker compose -f compose/desktop/win11.yml up win11
docker compose -f compose/legacy/winxp.yml up winxp docker compose -f compose/legacy/winxp.yml up winxp
# Run all desktop versions
docker compose -f compose/desktop.yml up
# Run everything
docker compose -f compose/all.yml up
``` ```
### Configuration ### Configuration
Edit `.env` to customize resources for all VMs: Two pre-configured env files with optimized defaults:
| File | RAM | CPU | Disk | Used By |
|------|-----|-----|------|---------|
| `.env.modern` | 8G | 4 | 128G | Win 10/11, Server 2016+ |
| `.env.legacy` | 2G | 2 | 32G | Win 7/8, Vista, XP, 2000, Server 2003-2012, Tiny |
Edit these files to customize:
```bash ```bash
# Modern systems (Win 10/11, Server 2016+) # .env.modern or .env.legacy
MODERN_RAM_SIZE=8G RAM_SIZE=8G
MODERN_CPU_CORES=4 CPU_CORES=4
MODERN_DISK_SIZE=128G DISK_SIZE=128G
# Legacy systems (Win 7/8, Vista, XP, 2000, Server 2003-2012, Tiny)
LEGACY_RAM_SIZE=2G
LEGACY_CPU_CORES=2
LEGACY_DISK_SIZE=32G
# Common settings
USERNAME=Docker USERNAME=Docker
PASSWORD=admin PASSWORD=admin
LANGUAGE=en LANGUAGE=en
@ -153,18 +141,13 @@ LANGUAGE=en
### Folder Structure ### Folder Structure
``` ```
.env.modern # Modern system defaults (8G RAM)
.env.legacy # Legacy system defaults (2G RAM)
compose/ compose/
├── base-modern.yml # High-resource profile ├── desktop/ # Win 11, 10, 8.1, 7
├── base-legacy.yml # Low-resource profile ├── legacy/ # Vista, XP, 2000
├── all.yml # All versions ├── server/ # Server 2003-2025
├── desktop.yml # Desktop versions └── tiny/ # Tiny10, Tiny11
├── legacy.yml # Vista, XP, 2000
├── server.yml # Server versions
├── tiny.yml # Tiny versions
├── desktop/ # Individual desktop configs
├── legacy/ # Individual legacy configs
├── server/ # Individual server configs
└── tiny/ # Individual tiny configs
data/ # VM storage (per-version folders) data/ # VM storage (per-version folders)
├── win11/ ├── win11/