generated from kartoza/django-react-base
-
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.
initial project setup for api and worker
- Loading branch information
1 parent
419c1d4
commit 3178e26
Showing
122 changed files
with
702 additions
and
20,014 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,29 @@ | ||
{ | ||
"name": "Django Docker Environment", | ||
"remoteUser": "vscode", | ||
// "remoteUser": "vscode", | ||
"postCreateCommand": "git config --global --add safe.directory /home/web/project", | ||
"dockerComposeFile": [ | ||
"../deployment/docker-compose.yml", | ||
"../deployment/docker-compose.override.devcontainer.yml" | ||
], | ||
"service": "dev", | ||
"runServices": ["db", "redis", "celery_beat", "worker","dev"], | ||
"workspaceFolder": "/home/web/project", | ||
"settings": { | ||
"terminal.integrated.shell.linux": "/bin/bash", | ||
"python.pythonPath": "/usr/local/bin/python", | ||
"python.linting.pylintEnabled": true, | ||
"python.linting.enabled": true | ||
}, | ||
"runArgs": [ | ||
"--env-file", | ||
"../deployment/.env" | ||
], | ||
"portsAttributes": { | ||
"9000": { | ||
"label": "Frontend", | ||
"onAutoForward": "notify" | ||
"forwardPorts": [8000], | ||
"shutdownAction": "stopCompose", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": ["ms-python.python", "ms-azuretools.vscode-docker"], | ||
"settings": { | ||
"terminal.integrated.shell.linux": "/bin/bash", | ||
"python.pythonPath": "/usr/local/bin/python", | ||
"python.linting.pylintEnabled": true, | ||
"python.linting.enabled": true | ||
} | ||
} | ||
}, | ||
"forwardPorts": [8000, 9000], | ||
"extensions": ["ms-python.python", "ms-azuretools.vscode-docker"], | ||
"shutdownAction": "stopCompose" | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
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,11 @@ | ||
{ | ||
"git.enableCommitSigning": true, | ||
"python.testing.pytestArgs": [ | ||
"django_project", | ||
"-s", | ||
"-c", | ||
"${workspaceFolder}/django_project/pytest.ini" | ||
], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true | ||
} |
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
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,5 @@ | ||
version: '3.9' | ||
name: 'cplus' | ||
|
||
volumes: | ||
static-data: | ||
|
@@ -26,24 +27,24 @@ x-common-django: | |
- CSRF_TRUSTED_ORIGINS=${CSRF_TRUSTED_ORIGINS:-[]} | ||
- SENTRY_ENVIRONMENT=${SENTRY_ENVIRONMENT:-production} | ||
- SENTRY_DSN=${SENTRY_DSN:-} | ||
|
||
# Email where alters should be sent. This will be used by let's encrypt and as the django admin email. | ||
- ADMIN_USERNAME=${ADMIN_USERNAME:-admin} | ||
- ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin} | ||
- ADMIN_EMAIL=${ADMIN_EMAIL:[email protected]} | ||
volumes: | ||
- static-data:/home/web/static | ||
- media-data:/home/web/media | ||
# worker variables | ||
- CPLUS_QUEUE_CONCURRENCY=${CPLUS_QUEUE_CONCURRENCY:-1} | ||
restart: on-failure | ||
|
||
services: | ||
redis: | ||
image: bitnami/redis:7.0.2 | ||
container_name: "cplus_api_redis" | ||
environment: | ||
- REDIS_PASSWORD=${REDIS_PASSWORD:-redis_password} | ||
|
||
db: | ||
image: kartoza/postgis:14-3.3 | ||
container_name: "cplus_api_db" | ||
volumes: | ||
- data-volume:/opt/postgres/data | ||
environment: | ||
|
@@ -55,10 +56,11 @@ services: | |
|
||
dbbackups: | ||
image: kartoza/pg-backup:14-3.3 | ||
container_name: "cplus_api_dbbackups" | ||
environment: | ||
# take care to let the project name below match that | ||
# declared in the top of the makefile | ||
- DUMPPREFIX=PG_GeoSight | ||
- DUMPPREFIX=PG_Cplus_API | ||
# These are all defaults anyway, but setting explicitly in | ||
# case we ever want to ever use different credentials | ||
- POSTGRES_USER=${DATABASE_USERNAME:-docker} | ||
|
@@ -73,24 +75,49 @@ services: | |
|
||
django: | ||
<<: *default-common-django | ||
container_name: "cplus_api_django" | ||
command: 'uwsgi --ini /uwsgi.conf' | ||
volumes: | ||
- static-data:/home/web/static | ||
- media-data:/home/web/media | ||
links: | ||
- db | ||
- redis | ||
- worker | ||
|
||
worker: | ||
celery_beat: | ||
<<: *default-common-django | ||
container_name: "cplus_api_celery_beat" | ||
entrypoint: [] | ||
command: 'celery -A core worker -l info' | ||
command: 'celery -A core beat --loglevel=info --scheduler django_celery_beat.schedulers:DatabaseScheduler' | ||
links: | ||
- db | ||
- redis | ||
|
||
worker: | ||
<<: *default-common-django | ||
container_name: "cplus_api_worker" | ||
entrypoint: [] | ||
command: '/bin/bash -c /home/web/django_project/worker_entrypoint.sh' | ||
links: | ||
- celery_beat | ||
|
||
dev: | ||
image: kartoza/${COMPOSE_PROJECT_NAME:-django_project}_dev | ||
<<: *default-common-django | ||
container_name: "cplus_api_dev_django" | ||
entrypoint: [] | ||
volumes: | ||
- static-data:/home/web/static | ||
- media-data:/home/web/media | ||
links: | ||
- db | ||
- redis | ||
- worker | ||
|
||
nginx: | ||
image: nginx | ||
container_name: "cplus_api_nginx" | ||
hostname: nginx | ||
volumes: | ||
- conf-data:/etc/nginx/conf.d:ro | ||
|
Oops, something went wrong.