-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1238 from maykinmedia/feature/docker-celery
Some ❤️ for 🐳
- Loading branch information
Showing
7 changed files
with
122 additions
and
12 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,19 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
LOGLEVEL=${CELERY_LOGLEVEL:-INFO} | ||
CONCURRENCY=${CELERY_WORKER_CONCURRENCY:-1} | ||
|
||
QUEUE=${1:-${CELERY_WORKER_QUEUE:=celery}} | ||
WORKER_NAME=${2:-${CELERY_WORKER_NAME:="${QUEUE}"@%n}} | ||
|
||
_binary=$(which celery) | ||
|
||
if [[ "$ENABLE_COVERAGE" ]]; then | ||
_binary="coverage run $_binary" | ||
fi | ||
|
||
echo "Starting celery worker $WORKER_NAME with queue $QUEUE" | ||
exec $_binary --workdir src -A "open_inwoner" events -l info --camera django_celery_monitor.camera.Camera --frequency=2.0 & | ||
exec $_binary --workdir src -A "open_inwoner" worker -l $LOGLEVEL -c $CONCURRENCY -Q $QUEUE -n $WORKER_NAME -E --max-tasks-per-child=50 -l info -B --scheduler django_celery_beat.schedulers:DatabaseScheduler |
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,7 @@ | ||
CREATE USER open_inwoner; | ||
CREATE DATABASE open_inwoner; | ||
GRANT ALL PRIVILEGES ON DATABASE open_inwoner TO open_inwoner; | ||
\c open_inwoner; | ||
CREATE EXTENSION postgis; | ||
-- On Postgres 15+, connect to the database and grant schema permissions. | ||
-- GRANT USAGE, CREATE ON SCHEMA public TO openforms; |
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,14 @@ | ||
server { | ||
listen 80; | ||
server_name localhost; | ||
|
||
location /private-media { | ||
internal; | ||
alias /private-media; | ||
} | ||
|
||
location / { | ||
client_max_body_size 100M; | ||
proxy_pass http://web: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