Add missing public files

This commit is contained in:
Eugene Burmakin 2025-12-06 12:45:32 +01:00
parent 6fec2f0e0f
commit 0f311104a6
2 changed files with 12 additions and 0 deletions

View file

@ -67,6 +67,10 @@ COPY ../. ./
RUN SECRET_KEY_BASE_DUMMY=1 bundle exec rake assets:precompile \
&& rm -rf node_modules tmp/cache
# Copy public directory to temp location for syncing with volume at runtime
# This allows new static files to be added to the persistent volume
RUN cp -r public /tmp/public_assets
# Copy entrypoint scripts and grant execution permissions
COPY ./docker/web-entrypoint.sh /usr/local/bin/web-entrypoint.sh
RUN chmod +x /usr/local/bin/web-entrypoint.sh

View file

@ -34,6 +34,14 @@ export DATABASE_NAME
# Remove pre-existing puma/passenger server.pid
rm -f $APP_PATH/tmp/pids/server.pid
# Sync static assets from image to volume
# This ensures new files (like maps_maplibre styles) are copied to the persistent volume
if [ -d "/tmp/public_assets" ]; then
echo "📦 Syncing new static assets to public volume..."
cp -rn /tmp/public_assets/* $APP_PATH/public/ 2>/dev/null || true
echo "✅ Static assets synced!"
fi
# Function to check and create a PostgreSQL database
create_database() {
local db_name=$1