Skip to content

Commit

Permalink
docker -> front-end devs: b2b-postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
yyluchkiv committed Jun 10, 2024
1 parent 7d29a8e commit 9572fd5
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docker/b2b-postgres-server/application-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ logging:
# Spring PostgreSQL
spring:
datasource:
url: jdbc:postgresql://tech1-postgres:5432/tech1_b2b_postgres_server
url: jdbc:postgresql://t1f-b2b-postgres:5432/tech1_b2b_postgres_server
username: postgres
password: postgres
jpa:
Expand Down
44 changes: 34 additions & 10 deletions docker/b2b-postgres-server/docker-compose.docker.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,48 @@
version: "3.8"

services:
tech1:
t1f-b2b-postgres-server:
image: ghcr.io/tech1-io/tech1-framework-b2b-postgres-server:2.8.4
restart: unless-stopped
container_name: tech1-framework-b2b-postgres-server
container_name: t1f-b2b-postgres-server
networks:
- tech1-network
- t1f-network
ports:
- "8484:8484"
- "3002:3002"
depends_on:
t1f-b2b-postgres:
condition: service_healthy
links:
- t1f-b2b-postgres
environment:
- PORT=8484
- PORT=3002
- CONFIG_LOCATIONS=classpath:application.yml,file:/application-docker.yml
- JASYPT_PASSWORD=JJEPTECH1
- JVM_ARGUMENTS=-Xmx5g --add-opens=java.base/java.time=ALL-UNNAMED
volumes:
- ./application-docker.yml:/application-docker.yml
- ./GeoLite2-City.mmdb:/GeoLite2-City.mmdb

t1f-b2b-postgres:
image: postgres:14.3
restart: always
container_name: t1f-b2b-postgres
ports:
- "5432:5432"
networks:
- t1f-network
environment:
- POSTGRES_PASSWORD=postgres
volumes:
- t1f-b2b-postgres-data:/var/lib/postgresql/data
- ./init-postgres-database.sh:/docker-entrypoint-initdb.d/init-database.sh
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 5s
retries: 5

networks:
tech1-network:
name: tech1-network
t1f-network:
name: t1f-network
driver: bridge

volumes:
t1f-b2b-postgres-data:
6 changes: 6 additions & 0 deletions docker/b2b-postgres-server/init-postgres-database.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -e

psql -v ON_ERROR_STOP=1 <<-EOSQL
CREATE DATABASE tech1_b2b_postgres_server;
EOSQL
2 changes: 1 addition & 1 deletion docker/b2b-postgres-server/ssh.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

docker exec -it tech1-framework-b2b-postgres-server /bin/sh
docker exec -it t1f-b2b-postgres-server /bin/sh

0 comments on commit 9572fd5

Please sign in to comment.