diff --git a/config/back/config.yaml b/config/back/config.yaml index e6447f2..f77dbad 100644 --- a/config/back/config.yaml +++ b/config/back/config.yaml @@ -7,4 +7,12 @@ redis: db: 0 hydra: - host: https://oauth2.logidex.ru/admin \ No newline at end of file + host: https://oauth2.logidex.ru/admin + +db: + host: backend-db + port: 5432 + user: postgres + password: postgres + dbname: logidex-id + diff --git a/config/hydra/.env b/config/hydra/.env index 432de45..650e0cf 100644 --- a/config/hydra/.env +++ b/config/hydra/.env @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index d6f8c5e..be53789 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,7 @@ services: hydra: + container_name: + "logidex-id-hydra" image: oryd/hydra:v2.3.0 command: serve -c /etc/config/hydra/hydra.yml all --dev depends_on: @@ -13,6 +15,8 @@ services: env_file: - ./config/hydra/.env hydra-migrate: + container_name: + "logidex-id-hydra-migrate" image: oryd/hydra:v2.3.0 command: migrate -c /etc/config/hydra/hydra.yml sql up -e --yes volumes: @@ -25,7 +29,7 @@ services: - ./config/hydra/.env depends_on: - - db + - hydra-db nginx: container_name: "logidexid" image: nginx:latest @@ -42,8 +46,10 @@ services: - hydra networks: - appnet - - proxy +# - proxy front: + container_name: + "logidex-id-frontend" image: git.logidex.ru/fakz9/logidex-id-frontend:latest environment: - NODE_ENV=production @@ -51,16 +57,22 @@ services: networks: - appnet back: + container_name: + "logidex-id-backend" image: git.logidex.ru/fakz9/id-backend:latest depends_on: redis: condition: service_healthy + backend-db: + condition: service_started networks: - appnet volumes: - ./config/back/.env:/app/.env - ./config/back/config.yaml:/app/config.yaml redis: + container_name: + "logidex-id-redis" image: redis command: [ "redis-server", "--save", "60", "1", "--appendonly", "no" ] volumes: @@ -72,7 +84,9 @@ services: interval: 5s timeout: 2s retries: 5 - db: + hydra-db: + container_name: + "logidex-id-hydra-db" image: postgres:17-alpine restart: unless-stopped environment: @@ -83,13 +97,28 @@ services: - db:/var/lib/postgresql/data networks: - 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: appnet: external: false - proxy: - external: true +# proxy: +# external: true volumes: redis_data: db: driver: local + backed_db: + driver: local