Files
Palmr/docker-compose.yaml
2025-02-24 23:58:40 -03:00

112 lines
2.7 KiB
YAML

version: "3.8"
services:
api:
image: kyantech/palmr-api:v1-beta
container_name: palmr-api
depends_on:
postgres:
condition: "service_healthy"
minio:
condition: "service_started"
environment:
- PORT=3333
- DATABASE_URL=postgresql://palmr:palmr123@localhost:5432/palmr?schema=public
- MINIO_ENDPOINT=localhost
- MINIO_PORT=9000
- MINIO_USE_SSL=false
- MINIO_ROOT_USER=palmr
- MINIO_ROOT_PASSWORD=palmr123
- MINIO_REGION=sa-east-1
- MINIO_BUCKET_NAME=files
- FRONTEND_URL=http://localhost:4173
- MINIO_PUBLIC_URL=http://localhost:9000
ports:
- "3333:3333"
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3333/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
network_mode: "host"
extra_hosts:
- "postgres:127.0.0.1"
- "minio:127.0.0.1"
# The web(frontend) service only work correctly if you run your api on port 3333
web:
image: kyantech/palmr-app:v1-beta
container_name: palmr-web
ports:
- "4173:4173"
depends_on:
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:latest
container_name: minio
environment:
- MINIO_ROOT_USER=palmr
- MINIO_ROOT_PASSWORD=palmr123
- MINIO_SITE_REGION=sa-east-1
command: server /data --console-address ":9001"
volumes:
- minio_data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/ready"]
interval: 10s
timeout: 5s
retries: 5
ports:
- "9000:9000"
- "9001:9001"
minio-init:
image: minio/mc:latest
container_name: minio-init
depends_on:
minio:
condition: "service_healthy"
restart: "no"
entrypoint: >
sh -c "
sleep 5 &&
mc alias set myminio http://minio:9000 palmr palmr123 &&
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=palmr
- POSTGRESQL_PASSWORD=palmr123
- POSTGRESQL_DATABASE=palmr
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: