Update docker-compose.yml
Use `extends` rule with a template to enable both dev and prod envs on the same machine
This commit is contained in:
parent
a82840e0bf
commit
37327ed331
|
@ -0,0 +1,27 @@
|
||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
usermanager-api-dev:
|
||||||
|
extends:
|
||||||
|
file: docker-template.yml
|
||||||
|
service: usermanager-api
|
||||||
|
container_name: fids_usermanager_api_dev
|
||||||
|
environment:
|
||||||
|
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASS}@usermanager-db-dev/${POSTGRES_DB}
|
||||||
|
depends_on:
|
||||||
|
usermanager-db-dev:
|
||||||
|
condition: service_healthy
|
||||||
|
networks:
|
||||||
|
- auth-dev
|
||||||
|
|
||||||
|
usermanager-db-dev:
|
||||||
|
extends:
|
||||||
|
file: docker-template.yml
|
||||||
|
service: usermanager-db
|
||||||
|
container_name: fids_usermanager_db_dev
|
||||||
|
networks:
|
||||||
|
- auth-dev
|
||||||
|
|
||||||
|
networks:
|
||||||
|
auth-dev:
|
||||||
|
driver: bridge
|
|
@ -2,19 +2,9 @@ version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
usermanager-api:
|
usermanager-api:
|
||||||
container_name: fids_usermanager_api
|
extends:
|
||||||
image: ${API_IMAGE}
|
file: docker-template.yml
|
||||||
healthcheck:
|
service: usermanager-api
|
||||||
test: ["CMD", "nc", "-vz", "-w1", "localhost", "5000"]
|
|
||||||
interval: 2s
|
|
||||||
timeout: 2s
|
|
||||||
retries: 5
|
|
||||||
start_period: 2s
|
|
||||||
environment:
|
|
||||||
- TEST_TARGET=${TEST_TARGET}
|
|
||||||
- PORT=5000
|
|
||||||
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASS}@usermanager-db/${POSTGRES_DB}
|
|
||||||
- APP_SETTINGS=${APP_SETTINGS}
|
|
||||||
depends_on:
|
depends_on:
|
||||||
usermanager-db:
|
usermanager-db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
@ -22,24 +12,17 @@ services:
|
||||||
- auth
|
- auth
|
||||||
|
|
||||||
usermanager-db:
|
usermanager-db:
|
||||||
container_name: fids_usermanager_db
|
extends:
|
||||||
build:
|
file: docker-template.yml
|
||||||
context: ./db
|
service: usermanager-db
|
||||||
dockerfile: Dockerfile
|
volumes:
|
||||||
healthcheck:
|
- flights_db:/var/lib/postgresql/data
|
||||||
test: psql postgres --command "select 1" -U ${POSTGRES_USER}
|
|
||||||
interval: 2s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 10
|
|
||||||
start_period: 2s
|
|
||||||
expose:
|
|
||||||
- 5432
|
|
||||||
environment:
|
|
||||||
- POSTGRES_USER=${POSTGRES_USER}
|
|
||||||
- POSTGRES_PASSWORD=${POSTGRES_PASS}
|
|
||||||
networks:
|
networks:
|
||||||
- auth
|
- auth
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
auth:
|
auth:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
flights_db:
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
usermanager-api:
|
||||||
|
container_name: fids_usermanager_api
|
||||||
|
image: ${API_IMAGE}
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "nc", "-vz", "-w1", "localhost", "5000"]
|
||||||
|
interval: 2s
|
||||||
|
timeout: 2s
|
||||||
|
retries: 5
|
||||||
|
start_period: 2s
|
||||||
|
environment:
|
||||||
|
- TEST_TARGET=${TEST_TARGET}
|
||||||
|
- PORT=5000
|
||||||
|
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASS}@usermanager-db/${POSTGRES_DB}
|
||||||
|
- APP_SETTINGS=${APP_SETTINGS}
|
||||||
|
|
||||||
|
usermanager-db:
|
||||||
|
container_name: fids_usermanager_db
|
||||||
|
build:
|
||||||
|
context: ./db
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
healthcheck:
|
||||||
|
test: psql postgres --command "select 1" -U ${POSTGRES_USER}
|
||||||
|
interval: 2s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 10
|
||||||
|
start_period: 2s
|
||||||
|
expose:
|
||||||
|
- 5432
|
||||||
|
environment:
|
||||||
|
- POSTGRES_USER=${POSTGRES_USER}
|
||||||
|
- POSTGRES_PASSWORD=${POSTGRES_PASS}
|
|
@ -16,7 +16,7 @@ class DevelopmentConfig(BaseConfig):
|
||||||
|
|
||||||
class TestingConfig(BaseConfig):
|
class TestingConfig(BaseConfig):
|
||||||
TESTING = True
|
TESTING = True
|
||||||
SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_TEST_URL")
|
SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL")
|
||||||
BCRYPT_LOG_ROUNDS = 4
|
BCRYPT_LOG_ROUNDS = 4
|
||||||
ACCESS_TOKEN_EXPIRATION = 5
|
ACCESS_TOKEN_EXPIRATION = 5
|
||||||
REFRESH_TOKEN_EXPIRATION = 5
|
REFRESH_TOKEN_EXPIRATION = 5
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
flights-api-dev:
|
||||||
|
extends:
|
||||||
|
file: docker-template.yml
|
||||||
|
service: flights-api
|
||||||
|
container_name: fids_flights_api_dev
|
||||||
|
environment:
|
||||||
|
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASS}@flights-api-db-dev/${POSTGRES_DB}
|
||||||
|
depends_on:
|
||||||
|
flights-api-db-dev:
|
||||||
|
condition: service_healthy
|
||||||
|
networks:
|
||||||
|
- flights-dev
|
||||||
|
- subscriptions-dev
|
||||||
|
|
||||||
|
flights-api-db-dev:
|
||||||
|
extends:
|
||||||
|
file: docker-template.yml
|
||||||
|
service: flights-api-db
|
||||||
|
container_name: fids_flights_db_dev
|
||||||
|
networks:
|
||||||
|
- flights-dev
|
||||||
|
|
||||||
|
networks:
|
||||||
|
subscriptions-dev:
|
||||||
|
name: subscription-domain_subscriptions-dev
|
||||||
|
external: true
|
||||||
|
flights-dev:
|
||||||
|
driver: bridge
|
|
@ -1,21 +1,10 @@
|
||||||
version: '3.8'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
flights-api:
|
flights-api:
|
||||||
container_name: fids_flights_api
|
extends:
|
||||||
image: ${API_IMAGE}
|
file: docker-template.yml
|
||||||
healthcheck:
|
service: flights-api
|
||||||
test: ["CMD", "nc", "-vz", "-w1", "localhost", "5000"]
|
|
||||||
interval: 2s
|
|
||||||
timeout: 2s
|
|
||||||
retries: 5
|
|
||||||
start_period: 2s
|
|
||||||
environment:
|
|
||||||
- TEST_TARGET=${TEST_TARGET}
|
|
||||||
- PORT=5000
|
|
||||||
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASS}@flights-api-db/${POSTGRES_DB}
|
|
||||||
- APP_SETTINGS=${APP_SETTINGS}
|
|
||||||
depends_on:
|
depends_on:
|
||||||
flights-api-db:
|
flights-api-db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
@ -24,21 +13,11 @@ services:
|
||||||
- subscriptions
|
- subscriptions
|
||||||
|
|
||||||
flights-api-db:
|
flights-api-db:
|
||||||
container_name: fids_flights_db
|
extends:
|
||||||
build:
|
file: docker-template.yml
|
||||||
context: ./db
|
service: flights-api-db
|
||||||
dockerfile: Dockerfile
|
volumes:
|
||||||
healthcheck:
|
- flights_db:/var/lib/postgresql/data
|
||||||
test: psql postgres --command "select 1" -U ${POSTGRES_USER}
|
|
||||||
interval: 2s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 10
|
|
||||||
start_period: 2s
|
|
||||||
expose:
|
|
||||||
- 5432
|
|
||||||
environment:
|
|
||||||
- POSTGRES_USER=${POSTGRES_USER}
|
|
||||||
- POSTGRES_PASSWORD=${POSTGRES_PASS}
|
|
||||||
networks:
|
networks:
|
||||||
- flights
|
- flights
|
||||||
|
|
||||||
|
@ -48,3 +27,6 @@ networks:
|
||||||
external: true
|
external: true
|
||||||
flights:
|
flights:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
flights_db:
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
flights-api:
|
||||||
|
container_name: fids_flights_api
|
||||||
|
image: ${API_IMAGE}
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "nc", "-vz", "-w1", "localhost", "5000"]
|
||||||
|
interval: 2s
|
||||||
|
timeout: 2s
|
||||||
|
retries: 5
|
||||||
|
start_period: 2s
|
||||||
|
environment:
|
||||||
|
- TEST_TARGET=${TEST_TARGET}
|
||||||
|
- PORT=5000
|
||||||
|
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASS}@flights-api-db/${POSTGRES_DB}
|
||||||
|
- APP_SETTINGS=${APP_SETTINGS}
|
||||||
|
|
||||||
|
flights-api-db:
|
||||||
|
container_name: fids_flights_db
|
||||||
|
build:
|
||||||
|
context: ./db
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
healthcheck:
|
||||||
|
test: psql postgres --command "select 1" -U ${POSTGRES_USER}
|
||||||
|
interval: 2s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 10
|
||||||
|
start_period: 2s
|
||||||
|
expose:
|
||||||
|
- 5432
|
||||||
|
environment:
|
||||||
|
- POSTGRES_USER=${POSTGRES_USER}
|
||||||
|
- POSTGRES_PASSWORD=${POSTGRES_PASS}
|
|
@ -4,31 +4,21 @@ import os
|
||||||
class BaseConfig:
|
class BaseConfig:
|
||||||
TESTING = False
|
TESTING = False
|
||||||
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
||||||
SECRET_KEY = "my_precious"
|
|
||||||
ACCESS_TOKEN_EXPIRATION = 900 # 15 minutes
|
|
||||||
REFRESH_TOKEN_EXPIRATION = 2592000 # 30 days
|
|
||||||
|
|
||||||
|
|
||||||
class DevelopmentConfig(BaseConfig):
|
class DevelopmentConfig(BaseConfig):
|
||||||
SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL")
|
SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL")
|
||||||
BCRYPT_LOG_ROUNDS = 4
|
|
||||||
|
|
||||||
|
|
||||||
class TestingConfig(BaseConfig):
|
class TestingConfig(BaseConfig):
|
||||||
TESTING = True
|
TESTING = True
|
||||||
SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_TEST_URL")
|
SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL")
|
||||||
BCRYPT_LOG_ROUNDS = 4
|
|
||||||
ACCESS_TOKEN_EXPIRATION = 5
|
|
||||||
REFRESH_TOKEN_EXPIRATION = 5
|
|
||||||
|
|
||||||
|
|
||||||
class ProductionConfig(BaseConfig):
|
class ProductionConfig(BaseConfig):
|
||||||
BCRYPT_LOG_ROUNDS = 13
|
|
||||||
SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL")
|
SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL")
|
||||||
SECRET_KEY = os.getenv("SECRET_KEY", "my_precious")
|
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.SECRET_KEY = os.getenv("SECRET_KEY", "my_precious")
|
|
||||||
url = os.environ.get("DATABASE_URL")
|
url = os.environ.get("DATABASE_URL")
|
||||||
if url is not None and url.startswith("postgres://"):
|
if url is not None and url.startswith("postgres://"):
|
||||||
url = url.replace("postgres://", "postgresql://", 1)
|
url = url.replace("postgres://", "postgresql://", 1)
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
api-gateway-dev:
|
||||||
|
extends:
|
||||||
|
file: docker-template.yml
|
||||||
|
service: api-gateway
|
||||||
|
container_name: fids_api_gateway_dev
|
||||||
|
ports:
|
||||||
|
- 5001:5002
|
||||||
|
networks:
|
||||||
|
- auth-dev
|
||||||
|
- flights-dev
|
||||||
|
- gateway-dev
|
||||||
|
- subscriptions-dev
|
||||||
|
|
||||||
|
networks:
|
||||||
|
auth-dev:
|
||||||
|
name: auth-domain_auth-dev
|
||||||
|
external: true
|
||||||
|
flights-dev:
|
||||||
|
name: flights-domain_flights-dev
|
||||||
|
external: true
|
||||||
|
subscriptions-dev:
|
||||||
|
name: subscription-domain_subscriptions-dev
|
||||||
|
external: true
|
||||||
|
gateway-dev:
|
||||||
|
driver: bridge
|
|
@ -1,22 +1,12 @@
|
||||||
version: '3.8'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
api-gateway:
|
api-gateway:
|
||||||
container_name: fids_api_gateway
|
extends:
|
||||||
image: ${API_IMAGE}
|
file: docker-template.yml
|
||||||
|
service: api-gateway
|
||||||
ports:
|
ports:
|
||||||
- 5000:5002
|
- 5000:5002
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "nc", "-vz", "-w1", "localhost", "5002"]
|
|
||||||
interval: 2s
|
|
||||||
timeout: 2s
|
|
||||||
retries: 5
|
|
||||||
start_period: 2s
|
|
||||||
environment:
|
|
||||||
- TEST_TARGET=${TEST_TARGET}
|
|
||||||
- PORT=5000
|
|
||||||
- APP_SETTINGS=${APP_SETTINGS}
|
|
||||||
networks:
|
networks:
|
||||||
- auth
|
- auth
|
||||||
- flights
|
- flights
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
api-gateway:
|
||||||
|
container_name: fids_api_gateway
|
||||||
|
image: ${API_IMAGE}
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "nc", "-vz", "-w1", "localhost", "5002"]
|
||||||
|
interval: 2s
|
||||||
|
timeout: 2s
|
||||||
|
retries: 5
|
||||||
|
start_period: 2s
|
||||||
|
environment:
|
||||||
|
- TEST_TARGET=${TEST_TARGET}
|
||||||
|
- APP_SETTINGS=${APP_SETTINGS}
|
|
@ -0,0 +1,27 @@
|
||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
subscriptions-api-dev:
|
||||||
|
extends:
|
||||||
|
file: docker-template.yml
|
||||||
|
service: subscriptions-api
|
||||||
|
container_name: fids_subscriptions_api_dev
|
||||||
|
environment:
|
||||||
|
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASS}@subscriptions-db-dev/${POSTGRES_DB}
|
||||||
|
depends_on:
|
||||||
|
subscriptions-db-dev:
|
||||||
|
condition: service_healthy
|
||||||
|
networks:
|
||||||
|
- subscriptions-dev
|
||||||
|
|
||||||
|
subscriptions-db-dev:
|
||||||
|
extends:
|
||||||
|
file: docker-template.yml
|
||||||
|
service: subscriptions-db
|
||||||
|
container_name: fids_subscriptions_db_dev
|
||||||
|
networks:
|
||||||
|
- subscriptions-dev
|
||||||
|
|
||||||
|
networks:
|
||||||
|
subscriptions-dev:
|
||||||
|
driver: bridge
|
|
@ -1,49 +1,28 @@
|
||||||
version: '3.8'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
subscriptions-api:
|
subscriptions-api:
|
||||||
container_name: fids_subscriptions_api
|
extends:
|
||||||
image: ${API_IMAGE}
|
file: docker-template.yml
|
||||||
ports:
|
service: subscriptions-api
|
||||||
- 5002:5000
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "nc", "-vz", "-w1", "localhost", "5000"]
|
|
||||||
interval: 2s
|
|
||||||
timeout: 2s
|
|
||||||
retries: 5
|
|
||||||
start_period: 2s
|
|
||||||
environment:
|
|
||||||
- TEST_TARGET=${TEST_TARGET}
|
|
||||||
- PORT=5000
|
|
||||||
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASS}@subscriptions-api-db/${POSTGRES_DB}
|
|
||||||
- APP_SETTINGS=${APP_SETTINGS}
|
|
||||||
- TOKEN=${TOKEN}
|
|
||||||
depends_on:
|
depends_on:
|
||||||
subscriptions-api-db:
|
subscriptions-db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
networks:
|
networks:
|
||||||
- subscriptions
|
- subscriptions
|
||||||
|
|
||||||
subscriptions-api-db:
|
subscriptions-db:
|
||||||
container_name: fids_subscriptions_db
|
extends:
|
||||||
build:
|
file: docker-template.yml
|
||||||
context: ./db
|
service: subscriptions-db
|
||||||
dockerfile: Dockerfile
|
volumes:
|
||||||
healthcheck:
|
- subscriptions_db:/var/lib/postgresql/data
|
||||||
test: psql postgres --command "select 1" -U ${POSTGRES_USER}
|
|
||||||
interval: 2s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 10
|
|
||||||
start_period: 2s
|
|
||||||
expose:
|
|
||||||
- 5432
|
|
||||||
environment:
|
|
||||||
- POSTGRES_USER=${POSTGRES_USER}
|
|
||||||
- POSTGRES_PASSWORD=${POSTGRES_PASS}
|
|
||||||
networks:
|
networks:
|
||||||
- subscriptions
|
- subscriptions
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
subscriptions:
|
subscriptions:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
subscriptions_db:
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
subscriptions-api:
|
||||||
|
container_name: fids_subscriptions_api
|
||||||
|
image: ${API_IMAGE}
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "nc", "-vz", "-w1", "localhost", "5000"]
|
||||||
|
interval: 2s
|
||||||
|
timeout: 2s
|
||||||
|
retries: 5
|
||||||
|
start_period: 2s
|
||||||
|
environment:
|
||||||
|
- TEST_TARGET=${TEST_TARGET}
|
||||||
|
- PORT=5000
|
||||||
|
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASS}@subscriptions-db/${POSTGRES_DB}
|
||||||
|
- APP_SETTINGS=${APP_SETTINGS}
|
||||||
|
- TOKEN=${TOKEN}
|
||||||
|
|
||||||
|
subscriptions-db:
|
||||||
|
container_name: fids_subscriptions_db
|
||||||
|
build:
|
||||||
|
context: ./db
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
healthcheck:
|
||||||
|
test: psql postgres --command "select 1" -U ${POSTGRES_USER}
|
||||||
|
interval: 2s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 10
|
||||||
|
start_period: 2s
|
||||||
|
expose:
|
||||||
|
- 5432
|
||||||
|
environment:
|
||||||
|
- POSTGRES_USER=${POSTGRES_USER}
|
||||||
|
- POSTGRES_PASSWORD=${POSTGRES_PASS}
|
|
@ -4,31 +4,21 @@ import os
|
||||||
class BaseConfig:
|
class BaseConfig:
|
||||||
TESTING = False
|
TESTING = False
|
||||||
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
||||||
SECRET_KEY = "my_precious"
|
|
||||||
ACCESS_TOKEN_EXPIRATION = 900 # 15 minutes
|
|
||||||
REFRESH_TOKEN_EXPIRATION = 2592000 # 30 days
|
|
||||||
|
|
||||||
|
|
||||||
class DevelopmentConfig(BaseConfig):
|
class DevelopmentConfig(BaseConfig):
|
||||||
SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL")
|
SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL")
|
||||||
BCRYPT_LOG_ROUNDS = 4
|
|
||||||
|
|
||||||
|
|
||||||
class TestingConfig(BaseConfig):
|
class TestingConfig(BaseConfig):
|
||||||
TESTING = True
|
TESTING = True
|
||||||
SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_TEST_URL")
|
SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL")
|
||||||
BCRYPT_LOG_ROUNDS = 4
|
|
||||||
ACCESS_TOKEN_EXPIRATION = 5
|
|
||||||
REFRESH_TOKEN_EXPIRATION = 5
|
|
||||||
|
|
||||||
|
|
||||||
class ProductionConfig(BaseConfig):
|
class ProductionConfig(BaseConfig):
|
||||||
BCRYPT_LOG_ROUNDS = 13
|
|
||||||
SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL")
|
SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL")
|
||||||
SECRET_KEY = os.getenv("SECRET_KEY", "my_precious")
|
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.SECRET_KEY = os.getenv("SECRET_KEY", "my_precious")
|
|
||||||
url = os.environ.get("DATABASE_URL")
|
url = os.environ.get("DATABASE_URL")
|
||||||
if url is not None and url.startswith("postgres://"):
|
if url is not None and url.startswith("postgres://"):
|
||||||
url = url.replace("postgres://", "postgresql://", 1)
|
url = url.replace("postgres://", "postgresql://", 1)
|
||||||
|
|
Loading…
Reference in New Issue