-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new docker-compose.stripe.yaml that also launches the worker co…
…ntainer
- Loading branch information
Showing
6 changed files
with
76 additions
and
10 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
STRIPE_SECRET_KEY=sk_test_changeme | ||
STRIPE_WEBHOOK_SECRET=whsec_changeme |
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 |
---|---|---|
|
@@ -11,3 +11,4 @@ hushline/static/data/users_directory.json | |
/node_modules | ||
.coverage | ||
htmlcov | ||
.env.stripe |
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,52 @@ | ||
--- | ||
services: | ||
app: &app_env | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.dev | ||
ports: | ||
- 127.0.0.1:8080:8080 | ||
environment: | ||
FLASK_APP: hushline | ||
FLASK_ENV: development | ||
ENCRYPTION_KEY: bi5FDwhZGKfc4urLJ_ChGtIAaOPgxd3RDOhnvct10mw= | ||
SECRET_KEY: cb3f4afde364bfb3956b97ca22ef4d2b593d9d980a4330686267cabcd2c0befd | ||
SQLALCHEMY_DATABASE_URI: postgresql://hushline:hushline@postgres:5432/hushline | ||
REGISTRATION_CODES_REQUIRED: False | ||
SESSION_COOKIE_NAME: session | ||
NOTIFICATIONS_ADDRESS: notifications@hushline.app | ||
env_file: | ||
- .env.stripe | ||
volumes: | ||
- ./:/app | ||
depends_on: | ||
- postgres | ||
restart: always | ||
command: poetry run flask run --debug --host=0.0.0.0 --port=8080 --with-threads | ||
|
||
worker: | ||
<<: *app_env | ||
ports: [] | ||
restart: always | ||
command: poetry run flask stripe start-worker | ||
depends_on: | ||
- stripe_data | ||
|
||
stripe_data: | ||
<<: *app_env | ||
ports: [] | ||
restart: on-failure | ||
command: poetry run flask stripe create-products-and-prices | ||
|
||
dev_data: | ||
<<: *app_env | ||
ports: [] | ||
restart: on-failure | ||
command: make migrate-dev && ./scripts/dev_data.py | ||
|
||
postgres: | ||
image: postgres:16.4-alpine3.20 | ||
environment: | ||
POSTGRES_USER: hushline | ||
POSTGRES_PASSWORD: hushline | ||
POSTGRES_DB: hushline |
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,21 +1,12 @@ | ||
#!/usr/bin/env python | ||
from hushline import create_app | ||
from hushline.db import db | ||
from hushline.model import Tier | ||
|
||
|
||
def main() -> None: | ||
with create_app().app_context(): | ||
db.create_all() | ||
|
||
# Add tiers | ||
tiers = [ | ||
Tier(name="Free", monthly_amount=0), | ||
Tier(name="Business", monthly_amount=2000), | ||
] | ||
db.session.bulk_save_objects(tiers) | ||
db.session.commit() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |