-
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.
- Loading branch information
1 parent
a11d952
commit 773916c
Showing
9 changed files
with
364 additions
and
413 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
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,8 @@ | ||
#!/bin/bash | ||
|
||
# create bot data directory | ||
mkdir -p /app/bot_data | ||
chmod -R 755 /app/bot_data | ||
|
||
# start the bot | ||
exec python /app/reminder_tg_bot/reminder_bot.py |
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 @@ | ||
{} |
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,31 +1,35 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
echo "Checking installed Python packages..." | ||
pip freeze | ||
|
||
echo "Waiting for PostgreSQL..." | ||
while ! pg_isready -h $DB_HOST -p $DB_PORT -U $DB_USER; do | ||
echo "PostgreSQL is unavailable - sleeping" | ||
sleep 1 | ||
# wait for database | ||
while ! nc -z $DB_HOST $DB_PORT; do | ||
echo "Waiting for database..." | ||
sleep 1 | ||
done | ||
echo "PostgreSQL is up and running!" | ||
|
||
echo "Building React application..." | ||
cd frontend | ||
npm install | ||
npm run build | ||
cd .. | ||
echo "Database is available" | ||
|
||
mkdir -p /app/media | ||
mkdir -p /app/static | ||
mkdir -p /app/frontend/build/static | ||
|
||
chown -R www-data:www-data /app/media /app/static | ||
chmod -R 755 /app/media /app/static | ||
|
||
echo "Running migrations..." | ||
python manage.py migrate | ||
|
||
echo "Collecting static files..." | ||
python manage.py collectstatic --noinput | ||
# frontend dependencies and start development server | ||
if [ "$SERVICE_NAME" = "web" ]; then | ||
echo "Setting up frontend..." | ||
cd /app/frontend | ||
npm install | ||
# start react development server in the background | ||
npm start & | ||
cd /app | ||
fi | ||
|
||
echo "Starting Django server..." | ||
python manage.py runserver 0.0.0.0:8000 & | ||
# collect static files | ||
python manage.py collectstatic --noinput | ||
|
||
echo "Starting React development server..." | ||
cd frontend | ||
npm start | ||
# start django development server | ||
python manage.py runserver 0.0.0.0:8000 |
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.