Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0d77a3a0a8 | |||
| 0618b78725 | |||
| 0178e71c67 |
@@ -72,6 +72,14 @@ docker-compose up -d
|
||||
# Access at http://localhost:3005
|
||||
```
|
||||
|
||||
Note on Docker file permissions (PUID/PGID)
|
||||
- When using bind mounts (e.g., `./storage`, `./data`, `./logs`, `./events`), ensure the container user can write to these host folders. The backend runs as a non‑root user by default.
|
||||
- Set `PUID` and `PGID` in your `.env` to match your host user’s UID/GID (run `id -u` and `id -g` on the host). Compose maps the container user to these values.
|
||||
- Example in `.env`:
|
||||
- `PUID=1000`
|
||||
- `PGID=1000`
|
||||
- Without this, creating events, uploads, thumbnails, or logs can fail with “Permission denied”.
|
||||
|
||||
## 📖 Documentation
|
||||
|
||||
- 📘 [**Deployment Guide**](DEPLOYMENT_GUIDE.md) - Detailed installation instructions
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "picpeak-backend",
|
||||
"version": "1.0.123",
|
||||
"version": "1.0.124",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "picpeak-backend",
|
||||
"version": "1.0.123",
|
||||
"version": "1.0.124",
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.850.0",
|
||||
"@aws-sdk/lib-storage": "^3.850.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "picpeak-backend",
|
||||
"version": "1.0.123",
|
||||
"version": "1.0.124",
|
||||
"description": "Backend for PicPeak event photo sharing platform",
|
||||
"main": "server.js",
|
||||
"scripts": {
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "picpeak-frontend",
|
||||
"version": "1.0.123",
|
||||
"version": "1.0.124",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "picpeak-frontend",
|
||||
"version": "1.0.123",
|
||||
"version": "1.0.124",
|
||||
"dependencies": {
|
||||
"@tanstack/react-query": "^5.0.0",
|
||||
"@tiptap/extension-character-count": "^2.26.1",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "picpeak-frontend",
|
||||
"private": true,
|
||||
"version": "1.0.123",
|
||||
"version": "1.0.124",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
+18
-1
@@ -352,7 +352,7 @@ setup_docker_installation() {
|
||||
fi
|
||||
|
||||
log_step "Creating application directory at $app_dir"
|
||||
mkdir -p "$app_dir"/{storage/events/{active,archived},logs,backup,config}
|
||||
mkdir -p "$app_dir"/{storage/events/{active,archived},logs,backup,config,data,events}
|
||||
|
||||
# Clone repository
|
||||
log_step "Downloading PicPeak..."
|
||||
@@ -363,6 +363,16 @@ setup_docker_installation() {
|
||||
git clone "$REPO_URL" "$app_dir"
|
||||
fi
|
||||
|
||||
# Determine host user for container mapping (PUID/PGID)
|
||||
local host_uid host_gid
|
||||
if [[ -n "${SUDO_USER:-}" ]]; then
|
||||
host_uid=$(id -u "$SUDO_USER" 2>/dev/null || echo 1000)
|
||||
host_gid=$(id -g "$SUDO_USER" 2>/dev/null || echo 1000)
|
||||
else
|
||||
host_uid=$(id -u 2>/dev/null || echo 1000)
|
||||
host_gid=$(id -g 2>/dev/null || echo 1000)
|
||||
fi
|
||||
|
||||
# Generate secrets
|
||||
local jwt_secret=$(generate_jwt_secret)
|
||||
local db_password=$(generate_password)
|
||||
@@ -382,6 +392,10 @@ JWT_SECRET=$jwt_secret
|
||||
# Admin
|
||||
ADMIN_EMAIL=$ADMIN_EMAIL
|
||||
|
||||
# Runtime user mapping for Docker bind mounts
|
||||
PUID=$host_uid
|
||||
PGID=$host_gid
|
||||
|
||||
# Database
|
||||
DB_HOST=postgres
|
||||
DB_PORT=5432
|
||||
@@ -415,6 +429,9 @@ ENABLE_EXPIRATION_CHECKER=true
|
||||
ENABLE_EMAIL_SERVICE=true
|
||||
DEFAULT_EXPIRY_DAYS=30
|
||||
EOF
|
||||
|
||||
# Ensure bind mounts are writable by mapped user
|
||||
chown -R "$host_uid":"$host_gid" "$app_dir"/storage "$app_dir"/logs "$app_dir"/backup "$app_dir"/data "$app_dir"/events 2>/dev/null || true
|
||||
|
||||
# Create docker-compose.yml if it doesn't exist
|
||||
if [[ ! -f "$app_dir/docker-compose.yml" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user