mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-09-29 16:24:22 +10:00
quay.io/minio/mc:latest is no longer publicly pullable (401 UNAUTHORIZED), which broke the Docker publish workflow. Use the official amazon/aws-cli image to create the bucket idempotently via head-bucket || s3 mb.
119 lines
3.0 KiB
YAML
119 lines
3.0 KiB
YAML
name: reactive_resume
|
|
|
|
services:
|
|
reactive_resume:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.dev
|
|
restart: unless-stopped
|
|
env_file:
|
|
- path: .env.local
|
|
required: false
|
|
environment:
|
|
PORT: "3000"
|
|
SERVER_PORT: "3001"
|
|
APP_URL: http://localhost:3000
|
|
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/postgres
|
|
S3_ENDPOINT: http://seaweedfs:8333
|
|
REDIS_URL: redis://redis:6379
|
|
CHOKIDAR_USEPOLLING: "true"
|
|
ports:
|
|
- "127.0.0.1:3000:3000"
|
|
- "127.0.0.1:3001:3001"
|
|
volumes:
|
|
- ./data:/app/data
|
|
profiles:
|
|
- app
|
|
develop:
|
|
watch:
|
|
- action: sync
|
|
path: .
|
|
target: /app
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
seaweedfs:
|
|
condition: service_healthy
|
|
seaweedfs_create_bucket:
|
|
condition: service_completed_successfully
|
|
healthcheck:
|
|
test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:' + (process.env.SERVER_PORT ?? 3001) + '/api/health').then((r) => { if (!r.ok) process.exit(1); }).catch(() => process.exit(1));"]
|
|
start_period: 30s
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
postgres:
|
|
image: postgres:latest
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_DB: postgres
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql
|
|
ports:
|
|
- "127.0.0.1:5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
|
|
start_period: 10s
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
redis:
|
|
image: redis:latest
|
|
restart: unless-stopped
|
|
command: redis-server --appendonly yes
|
|
volumes:
|
|
- redis_data:/data
|
|
ports:
|
|
- "127.0.0.1:6379:6379"
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
start_period: 5s
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
seaweedfs:
|
|
image: chrislusf/seaweedfs:latest
|
|
restart: unless-stopped
|
|
command: server -s3 -filer -dir=/data -ip=0.0.0.0
|
|
environment:
|
|
AWS_ACCESS_KEY_ID: seaweedfs
|
|
AWS_SECRET_ACCESS_KEY: seaweedfs
|
|
volumes:
|
|
- seaweedfs_data:/data
|
|
ports:
|
|
- "127.0.0.1:8333:8333"
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://localhost:8888"]
|
|
start_period: 10s
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
seaweedfs_create_bucket:
|
|
image: amazon/aws-cli:latest
|
|
restart: on-failure
|
|
environment:
|
|
AWS_ACCESS_KEY_ID: seaweedfs
|
|
AWS_SECRET_ACCESS_KEY: seaweedfs
|
|
AWS_DEFAULT_REGION: us-east-1
|
|
entrypoint: >
|
|
/bin/sh -c "
|
|
aws --endpoint-url http://seaweedfs:8333 s3api head-bucket --bucket reactive-resume 2>/dev/null ||
|
|
aws --endpoint-url http://seaweedfs:8333 s3 mb s3://reactive-resume
|
|
"
|
|
depends_on:
|
|
seaweedfs:
|
|
condition: service_healthy
|
|
|
|
volumes:
|
|
postgres_data:
|
|
redis_data:
|
|
seaweedfs_data:
|