autoface commited on
Commit
429d345
Β·
1 Parent(s): 49523bd

Update the Dockerfile to simplify the directory structure, remove unnecessary file copying steps, and update the documentation to reflect how configuration files are used. Modified the restic startup script to directly reference configuration file paths within containers to ensure clearer logic for configuration file creation and path replacement.

Browse files
Dockerfile CHANGED
@@ -43,15 +43,12 @@ ENV HOME=/home/user \
43
  WORKDIR $HOME
44
 
45
  # Create required directories
46
- RUN mkdir -p /home/user/config /home/user/data /home/user/logs /home/user/filebrowser \
47
  /home/user/.cache/huggingface /home/user/downloads /home/user/temp
48
 
49
  # Copy project structure
50
  COPY --chown=user:user scripts/ /home/user/scripts/
51
- COPY --chown=user:user configs/ /home/user/configs/
52
-
53
- # Copy all configurations to config directory
54
- RUN cp -r /home/user/configs/* /home/user/config/ 2>/dev/null || true
55
 
56
  # Make scripts executable
57
  RUN find /home/user/scripts -name "*.sh" -exec chmod +x {} \;
 
43
  WORKDIR $HOME
44
 
45
  # Create required directories
46
+ RUN mkdir -p /home/user/config /home/user/data /home/user/logs \
47
  /home/user/.cache/huggingface /home/user/downloads /home/user/temp
48
 
49
  # Copy project structure
50
  COPY --chown=user:user scripts/ /home/user/scripts/
51
+ COPY --chown=user:user configs/ /home/user/config/
 
 
 
52
 
53
  # Make scripts executable
54
  RUN find /home/user/scripts -name "*.sh" -exec chmod +x {} \;
docs/DEVELOPMENT.md CHANGED
@@ -13,7 +13,7 @@
13
  β”‚ β”œβ”€β”€ core-service-start.sh # Your main service (IMPLEMENT THIS)
14
  β”‚ β”œβ”€β”€ filebrowser-start.sh # File browser startup
15
  β”‚ └── persistence-start.sh # Persistence service
16
- β”œβ”€β”€ configs/ # Configuration files
17
  β”œβ”€β”€ Dockerfile # Container build configuration
18
  └── docker-entrypoint.sh # Main container entry point
19
  ```
 
13
  β”‚ β”œβ”€β”€ core-service-start.sh # Your main service (IMPLEMENT THIS)
14
  β”‚ β”œβ”€β”€ filebrowser-start.sh # File browser startup
15
  β”‚ └── persistence-start.sh # Persistence service
16
+ β”œβ”€β”€ configs/ # Configuration template files (copied to /home/user/config/ at runtime)
17
  β”œβ”€β”€ Dockerfile # Container build configuration
18
  └── docker-entrypoint.sh # Main container entry point
19
  ```
docs/RESTIC_USAGE.md CHANGED
@@ -11,10 +11,8 @@ Restic is a fast, secure, and efficient backup tool that is now fully integrated
11
  Copy the configuration template and modify as needed:
12
 
13
  ```bash
14
- # Copy configuration file
15
- cp configs/restic.conf.template /home/user/config/restic.conf
16
-
17
- # Edit configuration file
18
  nano /home/user/config/restic.conf
19
  ```
20
 
 
11
  Copy the configuration template and modify as needed:
12
 
13
  ```bash
14
+ # Configuration file is already available in container
15
+ # Edit configuration file directly
 
 
16
  nano /home/user/config/restic.conf
17
  ```
18
 
scripts/start/restic-start.sh CHANGED
@@ -42,16 +42,16 @@ prepare_config() {
42
  log "Configuration file does not exist, creating from template..."
43
  mkdir -p "$(dirname "$config_file")"
44
 
45
- if [[ -f "./configs/restic.conf" ]]; then
46
  # Copy project configuration file and adapt paths
47
- cp "./configs/restic.conf" "$config_file"
48
 
49
  # Simple path replacement (adapt to different user environments)
50
  if [[ "$USER_HOME" != "/home/user" ]]; then
51
  sed -i "s|/home/user|$USER_HOME|g" "$config_file"
52
  fi
53
 
54
- log_success "Created configuration from template: ./configs/restic.conf"
55
  else
56
  # Create basic configuration
57
  cat > "$config_file" << EOF
 
42
  log "Configuration file does not exist, creating from template..."
43
  mkdir -p "$(dirname "$config_file")"
44
 
45
+ if [[ -f "$USER_HOME/config/restic.conf" ]]; then
46
  # Copy project configuration file and adapt paths
47
+ cp "$USER_HOME/config/restic.conf" "$config_file"
48
 
49
  # Simple path replacement (adapt to different user environments)
50
  if [[ "$USER_HOME" != "/home/user" ]]; then
51
  sed -i "s|/home/user|$USER_HOME|g" "$config_file"
52
  fi
53
 
54
+ log_success "Created configuration from template: $USER_HOME/config/restic.conf"
55
  else
56
  # Create basic configuration
57
  cat > "$config_file" << EOF