Fix Docker-based Development Workflow (#1031)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
YGoetschel
2025-12-11 12:48:14 +01:00
committed by GitHub
parent 1a4e95e940
commit 997f54e700
5 changed files with 162 additions and 13 deletions

View File

@@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
version: "3.8"
services:
# RustFS main service
rustfs:
@@ -30,11 +28,11 @@ services:
- "9000:9000" # S3 API port
- "9001:9001" # Console port
environment:
- RUSTFS_VOLUMES=/data/rustfs{0...3} # Define 4 storage volumes
- RUSTFS_VOLUMES=/data/rustfs{0..3} # Define 4 storage volumes
- RUSTFS_ADDRESS=0.0.0.0:9000
- RUSTFS_CONSOLE_ADDRESS=0.0.0.0:9001
- RUSTFS_CONSOLE_ENABLE=true
- RUSTFS_EXTERNAL_ADDRESS=:9000 # Same as internal since no port mapping
- RUSTFS_EXTERNAL_ADDRESS=:9000 # Same as internal since no port mapping
- RUSTFS_CORS_ALLOWED_ORIGINS=*
- RUSTFS_CONSOLE_CORS_ALLOWED_ORIGINS=*
- RUSTFS_ACCESS_KEY=rustfsadmin
@@ -43,9 +41,9 @@ services:
- RUSTFS_TLS_PATH=/opt/tls
- RUSTFS_OBS_ENDPOINT=http://otel-collector:4317
volumes:
- deploy/data/pro:/data
- deploy/logs:/app/logs
- deploy/data/certs/:/opt/tls # TLS configuration, you should create tls directory and put your tls files in it and then specify the path here
- ./deploy/data/pro:/data
- ./deploy/logs:/app/logs
- ./deploy/data/certs/:/opt/tls # TLS configuration, you should create tls directory and put your tls files in it and then specify the path here
networks:
- rustfs-network
restart: unless-stopped
@@ -61,7 +59,9 @@ services:
retries: 3
start_period: 40s
depends_on:
- otel-collector
otel-collector:
condition: service_started
required: false
# Development environment
rustfs-dev:
@@ -70,16 +70,17 @@ services:
build:
context: .
dockerfile: Dockerfile.source
target: dev
# Pure development environment
ports:
- "9010:9000" # S3 API port
- "9011:9001" # Console port
environment:
- RUSTFS_VOLUMES=/data/rustfs{1...4}
- RUSTFS_VOLUMES=/data/rustfs{0..3}
- RUSTFS_ADDRESS=0.0.0.0:9000
- RUSTFS_CONSOLE_ADDRESS=0.0.0.0:9001
- RUSTFS_CONSOLE_ENABLE=true
- RUSTFS_EXTERNAL_ADDRESS=:9010 # External port mapping 9010 -> 9000
- RUSTFS_EXTERNAL_ADDRESS=:9010 # External port mapping 9010 -> 9000
- RUSTFS_CORS_ALLOWED_ORIGINS=*
- RUSTFS_CONSOLE_CORS_ALLOWED_ORIGINS=*
- RUSTFS_ACCESS_KEY=devadmin
@@ -88,7 +89,8 @@ services:
- RUSTFS_OBS_LOG_DIRECTORY=/logs
volumes:
- .:/app # Mount source code to /app for development
- deploy/data/dev:/data
- cargo_registry:/usr/local/cargo/registry # Mount cargo registry to avoid re-downloading
- ./deploy/data/dev:/data
networks:
- rustfs-network
restart: unless-stopped
@@ -230,3 +232,5 @@ volumes:
driver: local
logs:
driver: local
cargo_registry:
driver: local