-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
131 lines (126 loc) · 3.15 KB
/
docker-compose.yml
File metadata and controls
131 lines (126 loc) · 3.15 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
services:
# In-memory backend for testing
sftp-memory:
build: .
container_name: sftp-memory
ports:
- "2222:2222"
environment:
BACKEND: memory
PORT: "2222"
SFTP_USERS: "user:changeme"
RUST_LOG: "sftp_s3=info"
volumes:
- ./keys:/keys:ro
- ./config:/config:ro
restart: unless-stopped
healthcheck:
test: ["CMD", "timeout", "5", "bash", "-c", "</dev/tcp/127.0.0.1/2222"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# Local filesystem backend
sftp-local:
build: .
container_name: sftp-local
ports:
- "2223:2223"
environment:
BACKEND: local
PORT: "2223"
SFTP_USERS: "user:changeme"
LOCAL_ROOT: "/data"
RUST_LOG: "sftp_s3=info"
volumes:
- ./keys:/keys:ro
- ./config:/config:ro
- sftp-data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "timeout", "5", "bash", "-c", "</dev/tcp/127.0.0.1/2223"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# AWS S3 backend (requires AWS credentials)
sftp-s3:
build: .
container_name: sftp-s3
ports:
- "2224:2224"
environment:
BACKEND: s3
PORT: "2224"
SFTP_USERS: "${SFTP_USERS}"
S3_BUCKET: "${S3_BUCKET}"
S3_PREFIX: "${S3_PREFIX:-sftp/}"
AWS_REGION: "${AWS_REGION:-us-east-1}"
AWS_ACCESS_KEY_ID: "${AWS_ACCESS_KEY_ID}"
AWS_SECRET_ACCESS_KEY: "${AWS_SECRET_ACCESS_KEY}"
RUST_LOG: "sftp_s3=info"
volumes:
- ./keys:/keys:ro
- ./config:/config:ro
restart: unless-stopped
healthcheck:
test: ["CMD", "timeout", "5", "bash", "-c", "</dev/tcp/127.0.0.1/2224"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# LocalStack for local S3 testing
localstack:
image: localstack/localstack:latest
container_name: localstack
ports:
- "4566:4566"
environment:
SERVICES: "s3"
DEBUG: "0"
DATA_DIR: "/tmp/localstack/data"
AWS_DEFAULT_REGION: "us-east-1"
AWS_ACCESS_KEY_ID: "test"
AWS_SECRET_ACCESS_KEY: "test"
volumes:
- localstack-data:/tmp/localstack
restart: unless-stopped
healthcheck:
test: ["CMD", "awslocal", "s3", "ls"]
interval: 5s
timeout: 5s
retries: 10
start_period: 5s
# SFTP connected to LocalStack S3
sftp-s3-local:
build: .
container_name: sftp-s3-local
ports:
- "2225:2225"
environment:
BACKEND: s3
PORT: "2225"
SFTP_USERS: "user:localstacktest"
S3_BUCKET: "test-bucket"
S3_PREFIX: "sftp/"
S3_ENDPOINT: "http://localstack:4566"
AWS_REGION: "us-east-1"
AWS_ACCESS_KEY_ID: "test"
AWS_SECRET_ACCESS_KEY: "test"
RUST_LOG: "sftp_s3=info"
volumes:
- ./keys:/keys:ro
- ./config:/config:ro
restart: unless-stopped
depends_on:
localstack:
condition: service_healthy
healthcheck:
test: ["CMD", "timeout", "5", "bash", "-c", "</dev/tcp/127.0.0.1/2225"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
volumes:
sftp-data:
localstack-data: