-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
106 lines (101 loc) · 2.19 KB
/
Copy pathdocker-compose.yml
File metadata and controls
106 lines (101 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
services:
# Debian 版本
debian-ssh:
build:
context: ./debian
dockerfile: Dockerfile
container_name: debian-ssh
hostname: debian-ssh
privileged: true
ports:
- "10020:22"
- "20020-20029:20020-20029/tcp"
- "20020-20029:20020-20029/udp"
cap_add:
- NET_ADMIN
- NET_RAW
sysctls:
- net.ipv4.ip_forward=1
environment:
- ROOT_PASSWORD=123456
- TZ=Asia/Shanghai
volumes:
- ./data:/data
restart: unless-stopped
deploy:
resources:
limits:
cpus: '1.0'
memory: 512M
networks:
nat-net:
ipv4_address: 192.168.10.2
# Alpine 版本
alpine-ssh:
build:
context: ./alpine
dockerfile: Dockerfile
container_name: alpine-ssh
hostname: alpine-ssh
privileged: true
ports:
- "10030:22"
- "20030-20039:20030-20039/tcp"
- "20030-20099:20030-20039/udp"
cap_add:
- NET_ADMIN
- NET_RAW
sysctls:
- net.ipv4.ip_forward=1
environment:
- ROOT_PASSWORD=123456
- TZ=Asia/Shanghai
volumes:
- ./data/alpine-ssh:/data
restart: unless-stopped
deploy:
resources:
limits:
cpus: '1.0'
memory: 128M
networks:
nat-net:
ipv4_address: 192.168.10.3
# CentOS 版本
centos-ssh:
build:
context: ./centos
dockerfile: Dockerfile
container_name: centos-ssh
hostname: centos-ssh
privileged: true
ports:
- "10040:22"
- "20040-20049:20040-20049/tcp"
- "20040-20049:20040-20049/udp"
cap_add:
- NET_ADMIN
- NET_RAW
sysctls:
- net.ipv4.ip_forward=1
environment:
- ROOT_PASSWORD=123456
- TZ=Asia/Shanghai
volumes:
- ./data/centos-ssh:/data
restart: unless-stopped
deploy:
resources:
limits:
cpus: '1.0'
memory: 512M
networks:
nat-net:
ipv4_address: 192.168.10.4
networks:
nat-net:
driver: bridge
ipam:
config:
- subnet: 192.168.10.0/24
gateway: 192.168.10.1