diff --git a/.gitignore b/.gitignore index f23e614..76d4f8e 100644 --- a/.gitignore +++ b/.gitignore @@ -26,7 +26,4 @@ apps/web/*.sw? #SERVER apps/server/node_modules apps/server/.env -apps/server/dist/* - -#COMPOSE -docker-compose.yaml \ No newline at end of file +apps/server/dist/* \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..970398b --- /dev/null +++ b/docker-compose.yaml @@ -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: