Skip to content

Commit

Permalink
Merge pull request #552 from LerianStudio/feature/MIDAZ-551
Browse files Browse the repository at this point in the history
Feature/MIDAZ-551
  • Loading branch information
MartinezAvellan authored Feb 27, 2025
2 parents 63749aa + daef69f commit aca88f4
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 48 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: "Build midaz images"

on:
push:
Expand Down Expand Up @@ -26,6 +27,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
Expand All @@ -41,11 +45,12 @@ jobs:
type=semver,pattern={{version}}
type=ref,event=branch,suffix=-${{ github.sha }}
- name: Build Docker image
- name: Build and Push Docker image (Multi-Arch)
uses: docker/build-push-action@v5
with:
file: ${{ matrix.app.working_dir }}/Dockerfile
load: true
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}

- name: Extract tag name
Expand All @@ -62,10 +67,3 @@ jobs:
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
exit-code: '1'

- name: Push Docker image
uses: docker/build-push-action@v5
with:
file: ${{ matrix.app.working_dir }}/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
70 changes: 31 additions & 39 deletions components/infra/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,13 @@
x-midaz-postgres-common:
&midaz-postgres-common
image: postgres:latest
restart: always
user: ${USER_EXECUTE_COMMAND}
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${DB_USER} -p ${DB_PORT}" ]
interval: 10s
timeout: 5s
retries: 5
networks:
- infra_network

x-midaz-mongodb-common:
&midaz-mongodb-common
image: mongo:latest
restart: always
healthcheck:
test: echo 'db.runCommand("ping").ok'
interval: 10s
timeout: 5s
retries: 5
networks:
- infra_network

x-midaz-redis-common:
&midaz-redis-common
image: redis:latest
restart: always
env_file:
- .env
networks:
- infra_network

services:
midaz-mongodb:
<<: *midaz-mongodb-common
container_name: midaz-mongodb
image: mongo:latest
restart: always
healthcheck:
test: echo 'db.runCommand("ping").ok'
interval: 10s
timeout: 5s
retries: 5
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USER}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD}
Expand All @@ -44,22 +16,36 @@ services:
- ${MONGO_PORT}:${MONGO_PORT}
volumes:
- mongodb-data:/data/db
networks:
- infra_network

midaz-redis:
<<: *midaz-redis-common
container_name: midaz-redis
image: valkey/valkey:latest
restart: always
env_file:
- .env
environment:
- REDIS_USER=${REDIS_USER}
- REDIS_PASSWORD=${REDIS_PASSWORD}
command: ["redis-server", "--requirepass", "${REDIS_PASSWORD}", "--user", "${REDIS_USER}", "--port ${REDIS_PORT}"]
command: ["redis-server", "--requirepass", "${REDIS_PASSWORD}", "--port", "${REDIS_PORT}"]
ports:
- ${REDIS_PORT}:${REDIS_PORT}
volumes:
- redis-data:/data
networks:
- infra_network

midaz-postgres-primary:
<<: *midaz-postgres-common
container_name: midaz-postgres-primary
image: postgres:latest
restart: always
user: ${USER_EXECUTE_COMMAND}
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${DB_USER} -p ${DB_PORT}" ]
interval: 10s
timeout: 5s
retries: 5
ports:
- ${DB_PORT}:${DB_PORT}
environment:
Expand All @@ -80,10 +66,14 @@ services:
volumes:
- postgres-data:/var/lib/postgresql/data
- ./postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
networks:
- infra_network

midaz-postgres-replica:
<<: *midaz-postgres-common
container_name: midaz-postgres-replica
image: postgres:latest
restart: always
user: ${USER_EXECUTE_COMMAND}
ports:
- ${DB_REPLICA_PORT}:${DB_REPLICA_PORT}
environment:
Expand Down Expand Up @@ -121,6 +111,8 @@ services:
depends_on:
midaz-postgres-primary:
condition: service_healthy
networks:
- infra_network

midaz-pgbouncer:
image: edoburu/pgbouncer
Expand Down

0 comments on commit aca88f4

Please sign in to comment.