6 changed files with 100 additions and 28 deletions
@ -0,0 +1,32 @@
@@ -0,0 +1,32 @@
|
||||
version: '3.8' |
||||
|
||||
services: |
||||
gitcitadel-online: |
||||
image: silberengel/gitcitadel-online:latest |
||||
container_name: gitcitadel-online |
||||
restart: unless-stopped |
||||
ports: |
||||
# Expose port 2323 for Apache reverse proxy (maps to container port 8080) |
||||
- "2323:8080" |
||||
volumes: |
||||
# Persist cache directory |
||||
# Note: Ensure the host cache directory is writable by UID 1000 (node user) |
||||
# Run: sudo chown -R 1000:1000 ./cache (or use 777 permissions) |
||||
- ./cache:/app/cache |
||||
# Optional: Mount config file to override defaults |
||||
# - ./config.yaml:/app/config.yaml:ro |
||||
# Optional environment variables (uncomment and set as needed): |
||||
# environment: |
||||
# - CONFIG_PATH=/app/config.yaml |
||||
# - LOG_LEVEL=info |
||||
healthcheck: |
||||
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/health"] |
||||
interval: 30s |
||||
timeout: 10s |
||||
retries: 3 |
||||
start_period: 40s |
||||
deploy: |
||||
resources: |
||||
limits: |
||||
cpus: '1' |
||||
memory: 512M |
||||
@ -0,0 +1,19 @@
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh |
||||
set -e |
||||
|
||||
# Ensure cache/media directory exists and is writable |
||||
# This handles both mounted volumes and container-internal directories |
||||
if [ ! -d "cache/media" ]; then |
||||
mkdir -p cache/media || { |
||||
echo "Error: Failed to create cache/media directory. Check permissions." >&2 |
||||
exit 1 |
||||
} |
||||
fi |
||||
|
||||
# Ensure the cache directory is writable |
||||
if [ ! -w "cache" ] || [ ! -w "cache/media" ]; then |
||||
echo "Warning: Cache directory may not be writable. Check permissions on mounted volume." >&2 |
||||
fi |
||||
|
||||
# Execute the main application |
||||
exec "$@" |
||||
Loading…
Reference in new issue