-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: readme and script to start docker environment
- Loading branch information
1 parent
7200e1f
commit 811e89d
Showing
3 changed files
with
61 additions
and
15 deletions.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
# Exit immediately if a command exits with a non-zero status. | ||
set -e | ||
|
||
echo "Starting Docker environment for turlink-be..." | ||
|
||
# Build Docker images | ||
echo "Building Docker images..." | ||
docker-compose build | ||
|
||
# Start the containers | ||
echo "Starting Docker containers..." | ||
docker-compose up -d | ||
|
||
# Wait for the database to be ready | ||
echo "Waiting for database to be ready..." | ||
sleep 10 | ||
|
||
# Run database setup | ||
echo "Setting up the database..." | ||
docker-compose run web rails db:create | ||
docker-compose run web rails db:migrate | ||
|
||
# seed database | ||
echo "Seeding the database..." | ||
docker-compose run web rails db:seed | ||
|
||
echo "Setup complete! Your application should be running at http://localhost:3001" |