mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: some issues with "small" docker improvements (#12564)
* fix: support previous FORCE_BUILD_BEFORE_START variable too * fix: attempt to fix permission issues and inform properly on failure * fix: profile-gate redis and re-add profile-gated postgres to main file For now it's better to maintain compatibility - current postgres users will run mongodb unnecessarily withuot changes, but at least it'll still work fine
This commit is contained in:
@@ -30,6 +30,8 @@ services:
|
||||
# command: ["redis-server", "--save", "60", "1", "--loglevel", "warning"] # uncomment if you want to use snapshotting instead of AOF
|
||||
volumes:
|
||||
- redis-data:/data
|
||||
profiles:
|
||||
- redis
|
||||
|
||||
volumes:
|
||||
postgres-data:
|
||||
|
||||
@@ -33,6 +33,20 @@ services:
|
||||
# command: ['redis-server', '--save', '60', '1', '--loglevel', 'warning'] # uncomment if you want to use snapshotting instead of AOF
|
||||
volumes:
|
||||
- redis-data:/data
|
||||
profiles:
|
||||
- redis
|
||||
|
||||
postgres:
|
||||
image: postgres:16.1-alpine
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: nodebb
|
||||
POSTGRES_PASSWORD: nodebb
|
||||
POSTGRES_DB: nodebb
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
profiles:
|
||||
- postgres
|
||||
|
||||
volumes:
|
||||
mongo-data:
|
||||
@@ -49,6 +63,13 @@ volumes:
|
||||
type: none
|
||||
device: ./.docker/database/redis
|
||||
|
||||
postgres-data:
|
||||
driver: local
|
||||
driver_opts:
|
||||
o: bind
|
||||
type: none
|
||||
device: ./.docker/database/postgresql/data
|
||||
|
||||
nodebb-build:
|
||||
driver: local
|
||||
driver_opts:
|
||||
|
||||
@@ -7,7 +7,7 @@ set_defaults() {
|
||||
export CONFIG_DIR="${CONFIG_DIR:-/opt/config}"
|
||||
export CONFIG="$CONFIG_DIR/config.json"
|
||||
export NODEBB_INIT_VERB="${NODEBB_INIT_VERB:-install}"
|
||||
export START_BUILD="${START_BUILD:-false}"
|
||||
export START_BUILD="${START_BUILD:-${FORCE_BUILD_BEFORE_START:-false}}"
|
||||
export SETUP="${SETUP:-}"
|
||||
export PACKAGE_MANAGER="${PACKAGE_MANAGER:-npm}"
|
||||
export OVERRIDE_UPDATE_LOCK="${OVERRIDE_UPDATE_LOCK:-false}"
|
||||
@@ -24,9 +24,14 @@ check_directory() {
|
||||
}
|
||||
fi
|
||||
if [ ! -w "$dir" ]; then
|
||||
echo "Error: No write permission for directory $dir"
|
||||
echo "Warning: No write permission for directory $dir, attempting to fix..."
|
||||
chown -R $USER:$USER "$dir" || true # attempt to change ownership, do not exit on failure
|
||||
chmod -R 760 "$dir" || true # attempt to change permissions, do not exit on failure
|
||||
if [ ! -w "$dir" ]; then
|
||||
echo "Error: No write permission for directory $dir. Exiting..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to copy or link package.json and lock files based on package manager
|
||||
|
||||
Reference in New Issue
Block a user