diff --git a/docker/Dockerfile b/docker/Dockerfile index f9a6c3c0..05d52723 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -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 diff --git a/docker/web-entrypoint.sh b/docker/web-entrypoint.sh index 9642055f..8785446b 100644 --- a/docker/web-entrypoint.sh +++ b/docker/web-entrypoint.sh @@ -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