-
-
Notifications
You must be signed in to change notification settings - Fork 730
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
Use Dockerv2 #12875
Merged
mkllnk
merged 1 commit into
openfoodfoundation:master
from
macanudo527:docker/upgrade_to_dockerv2
Oct 1, 2024
Merged
Use Dockerv2 #12875
Changes from all commits
Commits
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 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 |
---|---|---|
|
@@ -14,12 +14,12 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v3 | ||
- run: docker/build | ||
- run: docker-compose up --detach | ||
- run: docker compose up --detach | ||
- run: until curl -f -s http://localhost:3000; do echo "waiting for api server"; sleep 1; done | ||
- run: docker-compose exec -T db psql postgresql://ofn:f00d@localhost:5432/open_food_network_dev --command="update spree_users set spree_api_key='testing' where login='[email protected]'" | ||
- run: docker compose exec -T db psql postgresql://ofn:f00d@localhost:5432/open_food_network_dev --command="update spree_users set spree_api_key='testing' where login='[email protected]'" | ||
# equivalent to Flipper.enable(:api_v1) | ||
- run: docker-compose exec -T db psql postgresql://ofn:f00d@localhost:5432/open_food_network_dev --command="insert into flipper_features (key, created_at, updated_at) values ('api_v1', localtimestamp, localtimestamp)" | ||
- run: docker-compose exec -T db psql postgresql://ofn:f00d@localhost:5432/open_food_network_dev --command="insert into flipper_gates (feature_key, key, value, created_at, updated_at) values ('api_v1', 'boolean', 'true', localtimestamp, localtimestamp)" | ||
- run: docker compose exec -T db psql postgresql://ofn:f00d@localhost:5432/open_food_network_dev --command="insert into flipper_features (key, created_at, updated_at) values ('api_v1', localtimestamp, localtimestamp)" | ||
- run: docker compose exec -T db psql postgresql://ofn:f00d@localhost:5432/open_food_network_dev --command="insert into flipper_gates (feature_key, key, value, created_at, updated_at) values ('api_v1', 'boolean', 'true', localtimestamp, localtimestamp)" | ||
|
||
# Run Mayhem for API | ||
- name: Run Mayhem for API | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
#!/bin/bash | ||
set +e | ||
|
||
docker-compose down -v --remove-orphans | ||
docker compose down -v --remove-orphans | ||
wait | ||
echo '###########################' | ||
echo 'BEGIN: docker-compose build' | ||
echo 'BEGIN: docker compose build' | ||
echo '###########################' | ||
docker-compose build # Set up the Docker containers | ||
docker compose build # Set up the Docker containers | ||
echo '##############################' | ||
echo 'FINISHED: docker-compose build' | ||
echo 'FINISHED: docker compose build' | ||
echo '##############################' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Write-Host "Docker cleaning: remove old containers" -ForegroundColor Blue | ||
docker-compose.exe down -v --remove-orphans | ||
docker compose down -v --remove-orphans | ||
Write-Host "Docker build: set up the docker containers" -ForegroundColor Blue | ||
docker-compose.exe build | ||
docker compose build | ||
Write-Host "Docker build finished" |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# This script runs RuboCop | ||
|
||
Write-Host "bundle exec rubocop : runs rubocop" -ForegroundColor Blue | ||
docker-compose.exe run web bundle exec rubocop | ||
docker compose run web bundle exec rubocop |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
#!/bin/bash | ||
|
||
echo '--------------------------------------------------------------' | ||
echo 'BEGIN: docker-compose run web bundle exec rake db:test:prepare' | ||
echo 'BEGIN: docker compose run web bundle exec rake db:test:prepare' | ||
echo '--------------------------------------------------------------' | ||
docker-compose run web bundle exec rake db:test:prepare | ||
docker compose run web bundle exec rake db:test:prepare | ||
echo '------------------------------------------------------------' | ||
echo 'END: docker-compose run web bundle exec rake db:test:prepare' | ||
echo 'END: docker compose run web bundle exec rake db:test:prepare' | ||
echo '------------------------------------------------------------' | ||
|
||
echo '--------------------------------------' | ||
echo 'BEGIN: running test suite (quiet mode)' | ||
echo '--------------------------------------' | ||
docker-compose run web bundle exec rspec spec | grep -v 'DEPRECATION WARNING' | grep -v 'Post.includes(:comments)' | grep -v 'Currently, Active Record recognizes the table in the string' | grep -v "If you don't rely on implicit join references" | ||
docker compose run web bundle exec rspec spec | grep -v 'DEPRECATION WARNING' | grep -v 'Post.includes(:comments)' | grep -v 'Currently, Active Record recognizes the table in the string' | grep -v "If you don't rely on implicit join references" | ||
echo '------------------------------------' | ||
echo 'END: running test suite (quiet mode)' | ||
echo '------------------------------------' |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# This script launches the whole stack of containers (web server, database, webpack, redis, etc.) | ||
$DateTime=Get-Date -Format "yyyyMMdd-HHmmss" | ||
|
||
Write-Host "Docker-compose up: launches the whole stack of containers" -ForegroundColor Blue | ||
docker-compose.exe up -d > log/server-$DateTime.log 2>&1 | ||
Write-Host "Docker-compose up finished : View this app in your web browser at http://localhost:3000/" -ForegroundColor Blue | ||
Write-Host "Docker compose up: launches the whole stack of containers" -ForegroundColor Blue | ||
docker compose up -d > log/server-$DateTime.log 2>&1 | ||
Write-Host "Docker compose up finished : View this app in your web browser at http://localhost:3000/" -ForegroundColor Blue |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you check if the
.exe
is not needed any more ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I'm not sure. It should have never been necessary. I can't get the server to respond in pure Windows using
docker-compose.exe
ordocker compose
The containers spin up with either of them, but I don't get a response from the server. I was hoping someone who uses it could provide some feedback.I develop with Ubuntu and WSL Ubuntu. I tested the docker setup with both and it works fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw you asked for feedback 👍 I think it's a minor use case so we should be good to merge as it is. If some run into any issue we can revisit. I'll wait a few more days for feedback before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. It is easy enough to revert if something comes up, so it should be relatively safe.