Skip to content

Commit

Permalink
resolves bug/flask-fastapi-celery-must-read-secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
memphis-tools committed Feb 2, 2025
2 parents 938a2c5 + 8246cb2 commit 458074b
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Screenshot](https://img.shields.io/badge/python-v3.11-blue?logo=python&logoColor=yellow)
![Screenshot](https://img.shields.io/badge/python-v3.12-blue?logo=python&logoColor=yellow)
![Screenshot](https://img.shields.io/badge/fastapi--blue?logo=fastapi&logoColor=yellow)
![Screenshot](https://img.shields.io/badge/flask--blue?logo=gitlab&logoColor=yellow)
![Screenshot](https://img.shields.io/badge/sqlalchemy--blue?logo=fastapi&logoColor=yellow)
Expand Down Expand Up @@ -70,7 +70,7 @@ Remember it's just a dummy project.
**A default virtual machine with 1vcpu and 2gb RAM is needed**

## TECHNOLOGIES
Python 3.11 and later
Python 3.12 and later

Postgresql 15 (driver psycopg 3)

Expand Down Expand Up @@ -403,6 +403,7 @@ You do not need to create a python virtualenv.
The passwords vars are used for the tests steps. They are not the ones in the vault.

CELERY_RESULT_BACKEND
CERTBOT_EMAIL
CI_REGISTRY_TOKEN
CI_REGISTRY_USER
CODACY_PROJECT_TOKEN
Expand All @@ -419,6 +420,10 @@ You do not need to create a python virtualenv.
TEST_USER_PWD
TIMEZONE

CERTBOT_EMAIL is set as Protected, Masked, Hidden and Expanded.

Notice: not all the necessary CI/CD variables are illustrated in the picture below.

![Screenshot](illustrations/dummy_fastapi_gitlab_settings.png)

See logs on Betterstack.
Expand All @@ -430,6 +435,10 @@ You do not need to create a python virtualenv.

- to see rabbitmq queue (once you get into the container)

rabbitmqctl list_users

rabbitmqctl list_vhosts

rabbitmqctl list_queues -p your_rabbitmq_user name messages

rabbitmqctl list_bindings -p your_rabbitmq_vhost
Expand Down
15 changes: 12 additions & 3 deletions deploy_docker-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ services:
- certbot-etc:/etc/letsencrypt
- certbot-var:/var/lib/letsencrypt
environment:
- ADMIN_EMAIL=/run/secrets/ADMIN_EMAIL
secrets:
- ADMIN_EMAIL
- CERTBOT_EMAIL
depends_on:
- nginx
command: certonly --webroot --webroot-path /var/www/html --email $ADMIN_EMAIL --agree-tos --no-eff-email --force-renewal -d dummy-ops.dev -d www.dummy-ops.dev
Expand Down Expand Up @@ -152,9 +150,20 @@ services:
- PDF_FOLDER_PATH
- PDF_FILE_NAME
- TIMEZONE
- POSTGRES_HOST
- POSTGRES_PORT
- POSTGRES_PRODUCTION_DB_NAME
- POSTGRES_TEST_DB_NAME
- POSTGRES_USER
- POSTGRES_PASSWORD
- SCOPE
secrets:
- CELERY_BROKER_URL
- SENDGRID_API_KEY
- POSTGRES_PASSWORD
- ADMIN_EMAIL
- ADMIN_LOGIN
- ADMIN_PASSWORD
volumes:
- static_volume:/home/dummy-operator/staticfiles
depends_on:
Expand Down
13 changes: 12 additions & 1 deletion local_docker-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,26 @@ services:
replicas: 1

celery:
image: dummy_fastapi_flask_blog_app-celery:latest
image: memphistools/public_repo:dummy_fastapi_flask_blog_app-celery_$GIT_COMMIT
environment:
- CELERY_RESULT_BACKEND
- PDF_FOLDER_PATH
- PDF_FILE_NAME
- TIMEZONE
- POSTGRES_HOST
- POSTGRES_PORT
- POSTGRES_PRODUCTION_DB_NAME
- POSTGRES_TEST_DB_NAME
- POSTGRES_USER
- POSTGRES_PASSWORD
- SCOPE
secrets:
- CELERY_BROKER_URL
- SENDGRID_API_KEY
- POSTGRES_PASSWORD
- ADMIN_EMAIL
- ADMIN_LOGIN
- ADMIN_PASSWORD
volumes:
- static_volume:/home/dummy-operator/staticfiles
depends_on:
Expand Down

0 comments on commit 458074b

Please sign in to comment.