Files
Palmr/docker-compose.yaml
Daniel Luiz Alves dca252827c refactor: remove deprecated Makefile and generate-docker-compose.sh
The Makefile and generate-docker-compose.sh script were removed as they are no longer needed. The docker-compose.yaml file was updated to include inline comments and use the latest image tag for the palmr-app service. This cleanup simplifies the project structure and ensures clarity in the docker-compose configuration.
2025-04-16 15:24:20 -03:00

110 lines
4.2 KiB
YAML

services:
palmr-api:
image: kyantech/palmr-api:latest # Make sure to use the correct version (latest) of the image
container_name: palmr-api
depends_on:
postgres:
condition: "service_healthy"
minio:
condition: "service_healthy"
environment:
- PORT=3333 # Port for the backend service
- DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD:-postgresRootPassword}@postgres:5432/palmr_db?schema=public # Database URL with configurable password through POSTGRES_PASSWORD env var
- MINIO_ENDPOINT=minio # This can change if your MinIO is at a different address
- MINIO_PORT=9000 # Default MinIO port (Change if yours is not the default)
- MINIO_USE_SSL=false
- MINIO_ROOT_USER=${MINIO_ROOT_USER:-minio_root_user} # MinIO credentials can be configured through MINIO_ROOT_USER env vars
- MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD:-minioRootPassword} # MinIO credentials can be configured through MINIO_ROOT_PASSWORD env vars
- MINIO_REGION=sa-east-1
- MINIO_BUCKET_NAME=files
- FRONTEND_URL=http://localhost:3000 # Frontend URL - Make sure to use the correct frontend URL, depends on where the frontend is running
- BASE_URL=http://localhost:3333
ports:
- "3333:3333" # Backend port mapping
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 # Make sure to use the correct version (latest) of the image
container_name: palmr-web
depends_on:
palmr-api:
condition: "service_healthy"
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- NEXT_TELEMETRY_DISABLED=1
- API_BASE_URL=http://palmr-api:3333 # Here we use docker's internal network to reference the backend service (can be changed if needed)
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 30s
timeout: 10s
retries: 3
minio:
image: minio/minio:RELEASE.2025-03-12T18-04-18Z # Use only version RELEASE.2025-03-12T18-04-18Z to avoid compatibility issues with the backend
container_name: minio
environment:
# MinIO credentials - same as above, configurable through environment variables
- MINIO_ROOT_USER=${MINIO_ROOT_USER:-minio_root_user}
- MINIO_ROOT_PASSWORD=${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 # Use only version RELEASE.2025-03-12T17-29-24Z to avoid compatibility issues with the backend and MinIO
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:-minio_root_user} ${MINIO_ROOT_PASSWORD:-minioRootPassword} &&
mc mb myminio/files --ignore-existing &&
mc anonymous set download myminio/files
"
postgres:
image: bitnami/postgresql:17.2.0 # You can use any postgres version you prefer, but remember that some versions might not be compatible
container_name: palmr-postgres
environment:
# PostgreSQL credentials configurable through environment variables
# POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB can be set to override defaults
- POSTGRESQL_USERNAME=${POSTGRES_USER:-postgres}
- POSTGRESQL_PASSWORD=${POSTGRES_PASSWORD:-postgresRootPassword}
- POSTGRESQL_DATABASE=${POSTGRES_DB:-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: