-
Notifications
You must be signed in to change notification settings - Fork 13
Docker environment improvements #158
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
14d6bbb
Add healthcheck condition for postgres replica dependency on primary
mateuscruz a838326
Add mariadb healthcheck
mateuscruz de66c2c
Add healthcheck condition for app container dependency on database se…
mateuscruz 57d0343
Add volumes for postgres containers
mateuscruz 985d257
Add volume for mariadb container
mateuscruz b679afa
Reduce healthcheck interval for faster container startup
mateuscruz 1e563c2
Update .dockerignore file
mateuscruz 566cd3f
Add default cmd for docker image
mateuscruz a9b129e
Bump image tag
mateuscruz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| v0.9.0.4 | ||
| v0.9.0.5 |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,19 @@ | ||
| .ash_history | ||
| .env | ||
| .irb_history | ||
| .irb_history | ||
| .irbrc | ||
| .rspec_status | ||
| .yardoc | ||
| **/.git | ||
| **/.github | ||
| **/*.sqlite3 | ||
| **/*.sqlite3-* | ||
| .irbrc | ||
| .irb_history | ||
| .yardoc | ||
| # rspec failure tracking | ||
| coverage | ||
| docker | ||
| Dockerfile | ||
| gemfiles/*.lock | ||
| pkg | ||
| spec/reports | ||
| tmp |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,16 @@ | ||
| .ash_history | ||
| .env | ||
| .irb_history | ||
| # rspec failure tracking | ||
| .rspec_status | ||
| /_yardoc/ | ||
| /.bundle/ | ||
| /.yardoc | ||
| /_yardoc/ | ||
| /coverage/ | ||
| /doc/ | ||
| /pkg/ | ||
| /spec/reports/ | ||
| /tmp/ | ||
| .env | ||
| gemfiles/*.lock | ||
| db/*.sqlite3 | ||
| db/*.sqlite3-* | ||
| # rspec failure tracking | ||
| .rspec_status | ||
| .irb_history | ||
| .ash_history | ||
| gemfiles/*.lock |
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #!/usr/bin/env sh | ||
|
|
||
| # Execs a command against the latest Active Record version defined in the Appraisals file | ||
| # Usage example | ||
| # bin/exec-latest irb (starts an IRB session with the latest AR version) | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| latest_ar_version=$(cat Appraisals | grep -oE "ar-\d+(.\d+)+" | tail -n1 | sed -E 's/(ar-)(.*)/\2/g') | ||
|
|
||
| bin/appraisal-exec $latest_ar_version "$@" |
This file contains hidden or 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
File renamed without changes.
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| #!/usr/bin/env sh | ||
|
|
||
| set -e | ||
|
|
||
| # Path to the PGDATA directory used inside the container | ||
| DATA_DIR="/var/lib/postgresql/data" | ||
|
|
||
| # Ensure the data directory exists | ||
| mkdir -p "$DATA_DIR" | ||
|
|
||
| # If the data directory is empty, perform an initial base backup from the primary. | ||
| # We intentionally DO NOT delete existing data so that container restarts keep the | ||
| # current replica state and avoid a full re-copy unless explicitly desired. | ||
| if [ -z "$(ls -A "$DATA_DIR" 2>/dev/null)" ]; then | ||
| echo "[replica-init] Data directory is empty - starting pg_basebackup from primary..." | ||
| # Retry until the primary becomes available. | ||
| until pg_basebackup \ | ||
| --pgdata="$DATA_DIR" \ | ||
| -R \ | ||
| --slot="${PRIMARY_REPLICATION_SLOT}" \ | ||
| --host="${PRIMARY_DATABASE_HOST}" \ | ||
| --port="${PRIMARY_DATABASE_PORT}"; do | ||
| echo "[replica-init] Primary not ready yet, retrying in 1s..." | ||
| sleep 1 | ||
| done | ||
| echo "[replica-init] Base backup completed." | ||
| else | ||
| echo "[replica-init] Data directory not empty - skipping pg_basebackup." | ||
| fi | ||
|
|
||
| # Tighten permissions (required by PostgreSQL if not already 0700) | ||
| chmod 0700 "$DATA_DIR" || true | ||
|
|
||
| echo "[replica-init] Starting PostgreSQL replica..." | ||
| exec postgres |
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.
Uh oh!
There was an error while loading. Please reload this page.