diff --git a/.gitignore b/.gitignore index 8f844cf..a26d8f7 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ workspace build/COPY_ROOT_EXTRA/ config/authorized_keys config/rclone +.env diff --git a/README.md b/README.md index 7b5cc02..a5dbb9a 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,11 @@ It is a good idea to leave the source tree alone and copy any edits you would li As this overlaying happens after the main build, it is easy to add extra files such as ML models and datasets to your images. You will also be able to rebuild quickly if your file overrides are made here. +Any directories and files that you add into `opt/storage` will be made available in the running container at `$WORKSPACE/storage`. + +This directory is monitored by `inotifywait`. Any items appearing in this directory will be automatically linked to the application directories as defined in `/opt/ai-dock/storage_monitor/etc/mappings.sh`. This is particularly useful if you need to run several applications that each need to make use of the stored files. + + ## Run Locally A 'feature-complete' `docker-compose.yaml` file is included for your convenience. All features of the image are included - Simply edit the environment variables in `.env`, save and then type `docker compose up`. @@ -129,7 +134,7 @@ You can use the included `cloudflared` service to make secure connections withou | `PROVISIONING_SCRIPT` | URL of a remote script to execute on init. See [note](#provisioning-script). | | `RCLONE_*` | Rclone configuration - See [rclone documentation](https://rclone.org/docs/#config-file) | | `SKIP_ACL` | Set `true` to skip modifying workspace ACL | -| `SSH_PORT` | Set a non-standard port for SSH (default `22`) | +| `SSH_PORT_LOCAL` | Set a non-standard port for SSH (default `22`) | | `SSH_PUBKEY` | Your public key for SSH | | `WEB_ENABLE_AUTH` | Enable password protection for web services (default `true`) | | `WEB_USER` | Username for web services (default `user`) | @@ -169,7 +174,7 @@ The URL must point to a plain text file - GitHub Gists/Pastebin (raw) are suitab If you are running locally you may instead opt to mount a script at `/opt/ai-dock/bin/provisioning.sh`. >[!NOTE] ->If configured, `sshd`, `cloudflared`, `rclone` & `logtail` will be launched before provisioning; Any other processes will launch after. +>If configured, `sshd`, `caddy`, `cloudflared`, `rclone`, `serviceportal`, `storagemonitor` & `logtail` will be launched before provisioning; Any other processes will launch after. >[!WARNING] >Only use scripts that you trust and which cannot be changed without your consent. @@ -325,6 +330,10 @@ This script follows and prints the log files for each of the above services to s If you are logged into the container you can follow the logs by running `logtail.sh` in your shell. +### Storage Monitor + +This service detects changes to files in `$WORKSPACE/storage` and creates symbolic links to the application directories defined in `/opt/ai-dock/storage_monitor/etc/mappings.sh` + ## Open Ports Some ports need to be exposed for the services to run or for certain features of the provided software to function diff --git a/build/COPY_ROOT_EXTRA/.gitkeep b/build/COPY_ROOT_EXTRA/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/docker-compose.yaml b/docker-compose.yaml index 2a495c9..7728612 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -48,17 +48,16 @@ services: ports: # SSH available on host machine port 2222 to avoid conflict. Change to suit - - ${SSH_PORT_HOST}:${SSH_PORT} + - ${SSH_PORT_HOST:-2222}:${SSH_PORT_LOCAL:-22} # Web UI for easy service access - - ${REDIRECTOR_PORT_HOST:-1111}:1111 + - ${SERVICEPORTAL_PORT_HOST:-1111}:${SERVICEPORTAL_PORT_HOST:-1111} # Rclone webserver for interactive configuration - - ${RCLONE_PORT_HOST:-53682}:53682 + - ${RCLONE_PORT_HOST:-53682}:${RCLONE_PORT_HOST:-53682} environment: # Don't enclose values in quotes - DIRECT_ADDRESS=${DIRECT_ADDRESS:-127.0.0.1} - DIRECT_ADDRESS_GET_WAN=${DIRECT_ADDRESS_GET_WAN:-false} - - SSH_PORT=${SSH_PORT:-22} - WORKSPACE=${WORKSPACE:-/workspace} - WORKSPACE_SYNC=${WORKSPACE_SYNC:-true} - CF_TUNNEL_TOKEN=${CF_TUNNEL_TOKEN:-} @@ -66,5 +65,10 @@ services: - WEB_ENABLE_AUTH=${WEB_ENABLE_AUTH:-true} - WEB_USER=${WEB_USER:-user} - WEB_PASSWORD=${WEB_PASSWORD:-password} + - SSH_PORT_HOST=${SSH_PORT_HOST:-2222} + - SSH_PORT_LOCAL=${SSH_PORT_LOCAL:-22} + - SERVICEPORTAL_PORT_HOST=${SERVICEPORTAL_PORT_HOST:-1111} + - SERVICEPORTAL_PORT_LOCAL=${SERVICEPORTAL_PORT_LOCAL:-11111} + - SERVICEPORTAL_METRICS_PORT=${SERVICEPORTAL_METRICS_PORT:-21111} - SERVERLESS=${SERVERLESS:-false} #- PROVISIONING_SCRIPT=https://raw.githubusercontent.com/ai-dock/pytorch/main/config/provisioning/default.sh \ No newline at end of file