Update the Dockerfile to use the official ruby slim image, rather than a custom image. This reduces the Docker image size and improves build times.
- Update the base build and development images to use the official ruby slim image
- Remove redundant arguments in the build and development stages
Using the official ruby slim image simplifies the build process and reduces the image size, resulting in faster build times and a more maintainable Dockerfile.
- Added new GitHub Actions to docker-main.yml to build and push base images
- Created a new Dockerfile.base with the base packages installation
- Modified the existing Dockerfile to use the new base image
- Created a new Dockerfile.build with the build stage to reduce the size of the final image
- Added 'public' directory to the chown command to ensure the
proper ownership for runtime files.
- This change enhances the security by ensuring that all
necessary directories are owned by the designated non-root
user.
The previous behavior did not account for the 'public'
directory, which could lead to permission issues at runtime.
- Implement BatchGenerateWeatherArtsWorker to handle batch
processing of weather art generation.
- Create GenerateWeatherArtWorker for individual weather art
generation tasks.
- Update Dockerfile to include redis-tools for Sidekiq support.
- Modify Gemfile to add sidekiq and sidekiq-scheduler gems.
- Configure Sidekiq in initializers and set up routes for
Sidekiq dashboard.
- Include a sidekiq.yml configuration for scheduling jobs.
- Create compose.yaml for Docker services including web,
database, Redis, and Sidekiq workers.
These changes introduce background processing capabilities
using Sidekiq, allowing for efficient generation of weather
art through scheduled and managed job queues, optimizing
performance and scalability.
- Change the precompilation command to include RAILS_BUILD=1
- This modification allows for environment-specific builds without altering the existing secret handling
This update enhances the flexibility of the asset precompilation process during deployment while maintaining the required application security measures.
- Added 'libpq-dev' to the packages installed in the Dockerfile
- Updated the base_uri in WeatherService to use 'dig' for safer access
These changes improve the Docker environment by ensuring that
necessary PostgreSQL development headers are available during
installation. The weather service now safely accesses the
URI from the credentials, reducing the risk of errors when
fetching nested configuration data.
- Add libpq5 to the list of installed packages for
database connections.
- Remove libpq-dev from the list as it is no longer
necessary for the build process.
These adjustments enhance the Docker image configuration,
ensuring the application can connect to PostgreSQL databases
without unnecessary build dependencies.
- Add libpq-dev to the list of packages installed for the build
- Ensure that the environment has the necessary dependencies
This change updates the Dockerfile to include the libpq-dev package,
which is required for compiling certain gem dependencies. The inclusion
of this package improves the compatibility of the environment with
database-related gems during the build process, ensuring a smoother
setup for development and deployment.