update database configuration in .env and docker-compose, add backend-db service
This commit is contained in:
@ -8,3 +8,11 @@ redis:
|
|||||||
|
|
||||||
hydra:
|
hydra:
|
||||||
host: https://oauth2.logidex.ru/admin
|
host: https://oauth2.logidex.ru/admin
|
||||||
|
|
||||||
|
db:
|
||||||
|
host: backend-db
|
||||||
|
port: 5432
|
||||||
|
user: postgres
|
||||||
|
password: postgres
|
||||||
|
dbname: logidex-id
|
||||||
|
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
DSN=postgres://postgres:postgres@db:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4
|
DSN=postgres://postgres:postgres@hydra-db:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
services:
|
services:
|
||||||
hydra:
|
hydra:
|
||||||
|
container_name:
|
||||||
|
"logidex-id-hydra"
|
||||||
image: oryd/hydra:v2.3.0
|
image: oryd/hydra:v2.3.0
|
||||||
command: serve -c /etc/config/hydra/hydra.yml all --dev
|
command: serve -c /etc/config/hydra/hydra.yml all --dev
|
||||||
depends_on:
|
depends_on:
|
||||||
@ -13,6 +15,8 @@ services:
|
|||||||
env_file:
|
env_file:
|
||||||
- ./config/hydra/.env
|
- ./config/hydra/.env
|
||||||
hydra-migrate:
|
hydra-migrate:
|
||||||
|
container_name:
|
||||||
|
"logidex-id-hydra-migrate"
|
||||||
image: oryd/hydra:v2.3.0
|
image: oryd/hydra:v2.3.0
|
||||||
command: migrate -c /etc/config/hydra/hydra.yml sql up -e --yes
|
command: migrate -c /etc/config/hydra/hydra.yml sql up -e --yes
|
||||||
volumes:
|
volumes:
|
||||||
@ -25,7 +29,7 @@ services:
|
|||||||
- ./config/hydra/.env
|
- ./config/hydra/.env
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- hydra-db
|
||||||
nginx:
|
nginx:
|
||||||
container_name: "logidexid"
|
container_name: "logidexid"
|
||||||
image: nginx:latest
|
image: nginx:latest
|
||||||
@ -42,8 +46,10 @@ services:
|
|||||||
- hydra
|
- hydra
|
||||||
networks:
|
networks:
|
||||||
- appnet
|
- appnet
|
||||||
- proxy
|
# - proxy
|
||||||
front:
|
front:
|
||||||
|
container_name:
|
||||||
|
"logidex-id-frontend"
|
||||||
image: git.logidex.ru/fakz9/logidex-id-frontend:latest
|
image: git.logidex.ru/fakz9/logidex-id-frontend:latest
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=production
|
- NODE_ENV=production
|
||||||
@ -51,16 +57,22 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- appnet
|
- appnet
|
||||||
back:
|
back:
|
||||||
|
container_name:
|
||||||
|
"logidex-id-backend"
|
||||||
image: git.logidex.ru/fakz9/id-backend:latest
|
image: git.logidex.ru/fakz9/id-backend:latest
|
||||||
depends_on:
|
depends_on:
|
||||||
redis:
|
redis:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
backend-db:
|
||||||
|
condition: service_started
|
||||||
networks:
|
networks:
|
||||||
- appnet
|
- appnet
|
||||||
volumes:
|
volumes:
|
||||||
- ./config/back/.env:/app/.env
|
- ./config/back/.env:/app/.env
|
||||||
- ./config/back/config.yaml:/app/config.yaml
|
- ./config/back/config.yaml:/app/config.yaml
|
||||||
redis:
|
redis:
|
||||||
|
container_name:
|
||||||
|
"logidex-id-redis"
|
||||||
image: redis
|
image: redis
|
||||||
command: [ "redis-server", "--save", "60", "1", "--appendonly", "no" ]
|
command: [ "redis-server", "--save", "60", "1", "--appendonly", "no" ]
|
||||||
volumes:
|
volumes:
|
||||||
@ -72,7 +84,9 @@ services:
|
|||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 2s
|
timeout: 2s
|
||||||
retries: 5
|
retries: 5
|
||||||
db:
|
hydra-db:
|
||||||
|
container_name:
|
||||||
|
"logidex-id-hydra-db"
|
||||||
image: postgres:17-alpine
|
image: postgres:17-alpine
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
@ -83,13 +97,28 @@ services:
|
|||||||
- db:/var/lib/postgresql/data
|
- db:/var/lib/postgresql/data
|
||||||
networks:
|
networks:
|
||||||
- appnet
|
- appnet
|
||||||
|
backend-db:
|
||||||
|
container_name:
|
||||||
|
"logidex-id-backend-db"
|
||||||
|
image: postgres:17-alpine
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_PASSWORD: postgres
|
||||||
|
POSTGRES_DB: logidex-id
|
||||||
|
volumes:
|
||||||
|
- backed_db:/var/lib/postgresql/data
|
||||||
|
networks:
|
||||||
|
- appnet
|
||||||
networks:
|
networks:
|
||||||
appnet:
|
appnet:
|
||||||
external: false
|
external: false
|
||||||
proxy:
|
# proxy:
|
||||||
external: true
|
# external: true
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
redis_data:
|
redis_data:
|
||||||
db:
|
db:
|
||||||
driver: local
|
driver: local
|
||||||
|
backed_db:
|
||||||
|
driver: local
|
||||||
|
|||||||
Reference in New Issue
Block a user