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 +2 -5
- docs/DEVELOPMENT.md +1 -1
- docs/RESTIC_USAGE.md +2 -4
- scripts/start/restic-start.sh +3 -3
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
|
| 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/
|
| 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 |
-
#
|
| 15 |
-
|
| 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 "
|
| 46 |
# Copy project configuration file and adapt paths
|
| 47 |
-
cp "
|
| 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:
|
| 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
|