chore: add docker-compose.yaml and update .gitignore

Add docker-compose.yaml to define services for the application stack, including API, app, MinIO, and PostgreSQL. Remove docker-compose.yaml from .gitignore to track it in version control
This commit is contained in:
Daniel Luiz Alves
2025-04-04 00:12:02 -03:00
parent fcd3b4e613
commit 68d6fd09af
2 changed files with 104 additions and 4 deletions

5
.gitignore vendored
View File

@@ -26,7 +26,4 @@ apps/web/*.sw?
#SERVER
apps/server/node_modules
apps/server/.env
apps/server/dist/*
#COMPOSE
docker-compose.yaml
apps/server/dist/*

103
docker-compose.yaml Normal file
View File

@@ -0,0 +1,103 @@
services:
palmr-api:
image: kyantech/palmr-api:latest
container_name: palmr-api
depends_on:
postgres:
condition: "service_healthy"
minio:
condition: "service_healthy"
environment:
- PORT=3333
- DATABASE_URL=postgresql://postgres:postgresRootPassword@postgres:5432/palmr_db?schema=public
- MINIO_ENDPOINT=minio
- MINIO_PORT=9000
- MINIO_USE_SSL=false
- MINIO_ROOT_USER=minio_root_user
- MINIO_ROOT_PASSWORD=minioRootPassword
- MINIO_REGION=sa-east-1
- MINIO_BUCKET_NAME=files
- FRONTEND_URL=http://localhost:4173
- BASE_URL=http://localhost:3333
ports:
- "3333:3333"
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3333/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
palmr-app:
image: kyantech/palmr-app:latest
container_name: palmr-web
ports:
- "4173:4173"
depends_on:
palmr-api:
condition: "service_healthy"
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4173"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
minio:
image: minio/minio:RELEASE.2025-03-12T18-04-18Z
container_name: minio
environment:
- MINIO_ROOT_USER=minio_root_user
- MINIO_ROOT_PASSWORD=minioRootPassword
- MINIO_SITE_REGION=sa-east-1
command: server /data --console-address ":9001"
volumes:
- minio_data:/data
ports:
- "9000:9000"
- "9001:9001"
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/ready"]
interval: 10s
timeout: 5s
retries: 5
minio-init:
image: minio/mc:RELEASE.2025-03-12T17-29-24Z
container_name: minio-init
depends_on:
minio:
condition: "service_healthy"
restart: "no"
entrypoint: >
sh -c "
sleep 5 &&
mc alias set myminio http://minio:9000 minio_root_user minioRootPassword &&
mc mb myminio/files --ignore-existing &&
mc anonymous set download myminio/files
"
postgres:
image: bitnami/postgresql:17.2.0
container_name: palmr-postgres
environment:
- POSTGRESQL_USERNAME=postgres
- POSTGRESQL_PASSWORD=postgresRootPassword
- POSTGRESQL_DATABASE=palmr_db
volumes:
- postgres_data:/bitnami/postgresql
ports:
- "5432:5432"
restart: unless-stopped
healthcheck:
test: ["CMD", "pg_isready", "-U", "palmr"]
interval: 10s
timeout: 5s
retries: 5
volumes:
minio_data:
postgres_data: