-
-
Notifications
You must be signed in to change notification settings - Fork 381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standardize docker & docker compose configs with improved docs #340
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Standardize naming of environment variables used to configure the app across Dockerfile and usage instructions. References to ONETIMESECRET_ were replaced with the generic REDIS_ and SECRET to avoid overspecifying the app name in the configs. This makes the environment configuration more consistent and reusable for deploying variations of the web app. The diff updates: - References to ONETIMESECRET_REDIS_URL and ONETIMESECRET_SECRET in the Dockerfile - References to ONETIMESECRET_REDIS_URL, ONETIMESECRET_SSL, ONETIMESECRET_HOST, and ONETIMESECRET_SECRET in the usage instructions To use the more generic names REDIS_URL, REDIS, HOST, and SECRET, which is clearer since these vars configure common services like Redis rather than being specific to OneTimeSecret. This avoid too tightly coupling the environment configuration to a particular app implementation.
The docker-compose documentation was updated with additional context and renamed some sections for clarity. Mounting the local directory into the app container during development was explained further to simplify running code changes without rebuilding the image each time. Minor configuration values were also consolidated for consistency. These changes aim to improve understanding of the documentation and local development workflow.
Uses the application's ONETIME_DEBUG environment variable that when set to true or 1 will enable shell debugging output by setting the -x flag. This allows visibility into the container startup process and any commands executed to help with debugging issues. Signed-off-by: delano <delano@onetimesecret.com>
This change copies the public/web assets directory into /mnt/public on container startup if that directory exists. This allows for simpler host access to static files, as they will be available at consistent paths both inside and outside the container. The /mnt/public directory is intended to map directly to /var/www/public on the host for easy web server configuration.
Explicitly documents the (existing) separate base, environment, and application layers through the use of intermediate build stages. Added detailed multilined comments above each layer to explain its purpose and how it builds upon the previous layer. This structure and addition of thorough comments improves understandability and maintainability of the Dockerfile over time.
Copy default configuration file if missing to provide sane defaults on initial run. Uses `--no-clobber` to prevent overwriting any custom configuration. This ensures new containers start with reasonable settings defined in the example and allows customizing via local config file.
Signed-off-by: delano <delano@onetimesecret.com>
delano
added
documentation
Issues or pull requests related to documentation.
tech debt
Addressing future rework costs due to quick, suboptimal solutions taken previously.
maintenance
Issues or tasks related to maintenance of the project.
labels
May 21, 2024
This change updates the Ruby versions tested in CI to the latest stable 3.1, 3.2 and 3.3 series. Testing on older unsupported versions provides little value, and keeping CI configuration updated makes potential issues easier to reproduce. The specific versions changed are: - Replace 3.1.4 with 3.1 - Replace 3.2.0 with 3.2 - Add 3.3 No functionality changes, only Ruby version updates for CI.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
documentation
Issues or pull requests related to documentation.
dx
Developer experience working with the project.
maintenance
Issues or tasks related to maintenance of the project.
tech debt
Addressing future rework costs due to quick, suboptimal solutions taken previously.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes to improve the configuration and documentation of the app:
Improve the docker-compose configuration documentation by providing additional context and renaming sections for clarity. The documentation now explains how to mount the local directory into the app container during development to simplify running code changes without rebuilding the image each time. Minor configuration values were also consolidated for consistency.
Add Docker Hub to automated image builds, allowing for easier deployment and versioning of the app.
Synchronize static assets for easier host access by copying the public/web assets directory into /mnt/public on container startup if it exists. This allows for simpler host access to static files, as they will be available at consistent paths both inside and outside the container.
Clarify the Dockerfile layers by explicitly documenting the separate base, environment, and application layers through the use of intermediate build stages. Detailed comments are added above each layer to explain its purpose and how it builds upon the previous layer.
Update the Dockerfile to ensure that the app configuration file exists by copying the default configuration file if it is missing. This provides sane defaults on the initial run and allows customization via a local config file.
Update the docker image name reference in the readme to reflect the latest changes.
Fix the pre-commit hook for issue numbers by adding the necessary configuration.
These changes aim to improve the consistency, documentation, and ease of use of the app.