feat(docker): add PUID/PGID and user mapping to avoid bind mount permission issues; feat(setup): prompt for admin email interactively; docs: PUID/PGID in .env.example
Mirror to GitHub / mirror (push) Successful in 1m41s
Test and Lint / backend-test (push) Successful in 1m47s
Test and Lint / frontend-test (push) Successful in 2m10s
Version and Release / version-bump (push) Successful in 1m5s
Version and Release / trigger-drone (push) Successful in 3s
Mirror to GitHub / mirror (push) Successful in 1m41s
Test and Lint / backend-test (push) Successful in 1m47s
Test and Lint / frontend-test (push) Successful in 2m10s
Version and Release / version-bump (push) Successful in 1m5s
Version and Release / trigger-drone (push) Successful in 3s
This commit is contained in:
@@ -53,6 +53,12 @@ VITE_API_URL=/api
|
||||
# Timezone
|
||||
TZ=UTC
|
||||
|
||||
# Runtime user mapping for Docker (optional)
|
||||
# Set these to your host user's UID/GID to avoid permission issues on bind mounts.
|
||||
# Run `id -u` and `id -g` on host to get values. Defaults to 1001.
|
||||
PUID=1001
|
||||
PGID=1001
|
||||
|
||||
# Analytics (Optional - Umami)
|
||||
VITE_UMAMI_URL=
|
||||
VITE_UMAMI_WEBSITE_ID=
|
||||
|
||||
+6
-1
@@ -29,6 +29,11 @@ services:
|
||||
- ADMIN_URL=${ADMIN_URL:-http://localhost:3001}
|
||||
- TZ=${TZ:-UTC}
|
||||
- STORAGE_PATH=/app/storage
|
||||
# Optional: run container as matching host user to avoid bind mount permission issues
|
||||
- PUID=${PUID:-1001}
|
||||
- PGID=${PGID:-1001}
|
||||
# Use host-matching user ID/GID so bind-mounted folders are writable
|
||||
user: "${PUID:-1001}:${PGID:-1001}"
|
||||
volumes:
|
||||
- ./events:/app/events
|
||||
- ./data:/app/data
|
||||
@@ -122,4 +127,4 @@ volumes:
|
||||
|
||||
networks:
|
||||
picpeak-network:
|
||||
driver: bridge
|
||||
driver: bridge
|
||||
|
||||
@@ -77,6 +77,21 @@ run_as_user() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Prompt for admin email interactively (unless provided or unattended)
|
||||
prompt_admin_email() {
|
||||
if [[ -n "$ADMIN_EMAIL" ]]; then
|
||||
return
|
||||
fi
|
||||
if [[ "$UNATTENDED" == "true" ]]; then
|
||||
ADMIN_EMAIL="admin@example.com"
|
||||
return
|
||||
fi
|
||||
echo
|
||||
echo "Please enter the admin email address (used for the initial admin account):"
|
||||
read -p "Admin email [admin@example.com]: " ADMIN_EMAIL
|
||||
ADMIN_EMAIL=${ADMIN_EMAIL:-admin@example.com}
|
||||
}
|
||||
|
||||
print_banner() {
|
||||
echo -e "${PURPLE}"
|
||||
echo "╔════════════════════════════════════════════════════════════════════════╗"
|
||||
@@ -1284,6 +1299,9 @@ main() {
|
||||
# Check system requirements
|
||||
check_system_requirements
|
||||
|
||||
# Prompt for admin email (design choice: always ask unless provided)
|
||||
prompt_admin_email
|
||||
|
||||
# Configure email (optional)
|
||||
configure_email
|
||||
|
||||
|
||||
Reference in New Issue
Block a user