Fix runtime data directory creation
Browse files- Dockerfile +4 -2
- docker/docker-entrypoint.sh +7 -0
Dockerfile
CHANGED
|
@@ -22,9 +22,8 @@ RUN \
|
|
| 22 |
# Create config and data directories with proper permissions
|
| 23 |
RUN \
|
| 24 |
rm -f "config.yaml" || true && \
|
| 25 |
-
ln -s "./config/config.yaml" "config.yaml" || true && \
|
| 26 |
mkdir -p "config" "data" && \
|
| 27 |
-
chmod -R 777 "data" "config"
|
| 28 |
|
| 29 |
# Pre-compile public libraries
|
| 30 |
RUN \
|
|
@@ -44,6 +43,9 @@ RUN \
|
|
| 44 |
# Fix extension repos permissions
|
| 45 |
RUN git config --global --add safe.directory "*"
|
| 46 |
|
|
|
|
|
|
|
|
|
|
| 47 |
EXPOSE 8000
|
| 48 |
|
| 49 |
# Ensure proper handling of kernel signals
|
|
|
|
| 22 |
# Create config and data directories with proper permissions
|
| 23 |
RUN \
|
| 24 |
rm -f "config.yaml" || true && \
|
|
|
|
| 25 |
mkdir -p "config" "data" && \
|
| 26 |
+
chmod -R 777 "data" "config" /home/node
|
| 27 |
|
| 28 |
# Pre-compile public libraries
|
| 29 |
RUN \
|
|
|
|
| 43 |
# Fix extension repos permissions
|
| 44 |
RUN git config --global --add safe.directory "*"
|
| 45 |
|
| 46 |
+
# Ensure data directory exists and is writable
|
| 47 |
+
RUN mkdir -p /home/node/app/data && chmod 777 /home/node/app/data
|
| 48 |
+
|
| 49 |
EXPOSE 8000
|
| 50 |
|
| 51 |
# Ensure proper handling of kernel signals
|
docker/docker-entrypoint.sh
CHANGED
|
@@ -1,10 +1,17 @@
|
|
| 1 |
#!/bin/sh
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
if [ ! -e "config/config.yaml" ]; then
|
| 4 |
echo "Resource not found, copying from defaults: config.yaml"
|
| 5 |
cp -r "default/config.yaml" "config/config.yaml"
|
| 6 |
fi
|
| 7 |
|
|
|
|
|
|
|
|
|
|
| 8 |
# Execute postinstall to auto-populate config.yaml with missing values
|
| 9 |
npm run postinstall
|
| 10 |
|
|
|
|
| 1 |
#!/bin/sh
|
| 2 |
|
| 3 |
+
# Create data directory if it doesn't exist
|
| 4 |
+
mkdir -p /home/node/app/data
|
| 5 |
+
chmod 777 /home/node/app/data
|
| 6 |
+
|
| 7 |
if [ ! -e "config/config.yaml" ]; then
|
| 8 |
echo "Resource not found, copying from defaults: config.yaml"
|
| 9 |
cp -r "default/config.yaml" "config/config.yaml"
|
| 10 |
fi
|
| 11 |
|
| 12 |
+
# Link config.yaml to root
|
| 13 |
+
ln -sf "./config/config.yaml" "./config.yaml" 2>/dev/null || true
|
| 14 |
+
|
| 15 |
# Execute postinstall to auto-populate config.yaml with missing values
|
| 16 |
npm run postinstall
|
| 17 |
|