-
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
Showing
13 changed files
with
128 additions
and
21 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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.tool-versions | ||
data/postgres/* | ||
data/nginx/ssl/* | ||
data/* | ||
|
||
!data/nginx/nginx.conf | ||
!data/nginx/ssl/.gitkeep |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# This will make sure the app is always imported when | ||
# Django starts so that shared_task will use this app. | ||
from .celery import app as celery_app | ||
|
||
__all__ = ("celery_app",) |
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,22 @@ | ||
import os | ||
|
||
from celery import Celery | ||
|
||
# Set the default Django settings module for the 'celery' program. | ||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ypovoli.settings") | ||
|
||
app = Celery("ypovoli") | ||
|
||
# Using a string here means the worker doesn't have to serialize | ||
# the configuration object to child processes. | ||
# - namespace='CELERY' means all celery-related configuration keys | ||
# should have a `CELERY_` prefix. | ||
app.config_from_object("django.conf:settings", namespace="CELERY") | ||
|
||
# Load task modules from all registered Django apps. | ||
app.autodiscover_tasks() | ||
|
||
|
||
@app.task(bind=True, ignore_result=True) | ||
def debug_task(self): | ||
print(f"Request: {self.request!r}") |
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,17 +1,28 @@ | ||
echo "Checking for existing SSL certificates..." | ||
|
||
if [ ! -f "data/nginx/ssl/private.key" ] || [ ! -f "data/nginx/ssl/certificate.crt" ]; then | ||
echo "Generating SSL certificates..." | ||
echo "Generating SSL certificates..." | ||
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 \ | ||
-keyout data/nginx/ssl/private.key \ | ||
-out data/nginx/ssl/certificate.crt \ | ||
-subj "/C=BE/ST=/L=/O=/OU=/CN=" | ||
-subj "/C=BE/ST=/L=/O=/OU=/CN=" > /dev/null | ||
echo "SSL certificates generated." | ||
else | ||
echo "SSL certificates already exist, skipping generation." | ||
fi | ||
|
||
echo "Starting services..." | ||
docker-compose -f development.yml up -d | ||
|
||
echo "Following logs..." | ||
docker-compose -f development.yml logs --follow --tail 50 backend | ||
echo "-------------------------------------" | ||
echo "Following backend logs..." | ||
echo "Press CTRL + C to stop all containers" | ||
echo "-------------------------------------" | ||
|
||
docker-compose -f development.yml logs --follow --tail 50 backend | ||
|
||
echo "Cleaning up..." | ||
|
||
docker-compose -f development.yml down | ||
|
||
echo "Done." |
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