mirror of
https://github.com/ghndrx/file-transformer-s3.git
synced 2026-02-10 06:45:05 +00:00
Initial commit: File Transformer S3 project with React dashboard and Knative functions
This commit is contained in:
195
docker-compose.yml
Normal file
195
docker-compose.yml
Normal file
@@ -0,0 +1,195 @@
|
||||
services:
|
||||
# PostgreSQL Database
|
||||
postgres:
|
||||
image: postgres:15-alpine
|
||||
container_name: file-transformer-postgres
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB:-file_transformer}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-file_user}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-secure_password_123}
|
||||
ports:
|
||||
- "${POSTGRES_PORT:-5432}:5432"
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
- ./database/init.sql:/docker-entrypoint-initdb.d/init.sql
|
||||
networks:
|
||||
- file-transformer-network
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-file_user}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
# MinIO Object Storage
|
||||
minio:
|
||||
image: minio/minio:latest
|
||||
container_name: file-transformer-minio
|
||||
environment:
|
||||
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY:-minioadmin}
|
||||
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY:-minioadmin123}
|
||||
ports:
|
||||
- "${MINIO_API_PORT:-9000}:9000"
|
||||
- "${MINIO_CONSOLE_PORT:-9001}:9001"
|
||||
volumes:
|
||||
- minio_data:/data
|
||||
networks:
|
||||
- file-transformer-network
|
||||
command: server /data --console-address ":9001"
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
|
||||
interval: 30s
|
||||
timeout: 20s
|
||||
retries: 3
|
||||
|
||||
# MinIO Client for bucket setup
|
||||
minio-client:
|
||||
image: minio/mc:latest
|
||||
container_name: file-transformer-minio-client
|
||||
depends_on:
|
||||
- minio
|
||||
environment:
|
||||
MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY:-minioadmin}
|
||||
MINIO_SECRET_KEY: ${MINIO_SECRET_KEY:-minioadmin123}
|
||||
networks:
|
||||
- file-transformer-network
|
||||
command: >
|
||||
sh -c "
|
||||
sleep 10 &&
|
||||
mc alias set local http://minio:9000 ${MINIO_ACCESS_KEY:-minioadmin} ${MINIO_SECRET_KEY:-minioadmin123} &&
|
||||
mc mb local/${MINIO_BUCKET_NAME:-file-transformer-bucket} --ignore-existing &&
|
||||
mc policy set public local/${MINIO_BUCKET_NAME:-file-transformer-bucket} &&
|
||||
echo 'MinIO bucket setup complete'
|
||||
"
|
||||
|
||||
# React Dashboard
|
||||
dashboard:
|
||||
build:
|
||||
context: ./dashboard
|
||||
dockerfile: Dockerfile
|
||||
container_name: file-transformer-dashboard
|
||||
ports:
|
||||
- "${REACT_APP_PORT:-3000}:3000"
|
||||
environment:
|
||||
- REACT_APP_API_BASE_URL=${REACT_APP_API_BASE_URL:-http://localhost:8080}
|
||||
- REACT_APP_MINIO_ENDPOINT=${REACT_APP_MINIO_ENDPOINT:-http://localhost:9000}
|
||||
- REACT_APP_MINIO_CONSOLE=${REACT_APP_MINIO_CONSOLE:-http://localhost:9001}
|
||||
networks:
|
||||
- file-transformer-network
|
||||
depends_on:
|
||||
- postgres
|
||||
- minio
|
||||
volumes:
|
||||
- ./dashboard:/app
|
||||
- /app/node_modules
|
||||
|
||||
# API Gateway (for local development)
|
||||
api-gateway:
|
||||
build:
|
||||
context: ./api-gateway
|
||||
dockerfile: Dockerfile
|
||||
container_name: file-transformer-api-gateway
|
||||
ports:
|
||||
- "8080:8080"
|
||||
environment:
|
||||
- POSTGRES_URL=${POSTGRES_URL}
|
||||
- MINIO_ENDPOINT=${MINIO_ENDPOINT}
|
||||
- MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY}
|
||||
- MINIO_SECRET_KEY=${MINIO_SECRET_KEY}
|
||||
- MINIO_BUCKET_NAME=${MINIO_BUCKET_NAME}
|
||||
- JWT_SECRET=${JWT_SECRET}
|
||||
- CORS_ORIGINS=${CORS_ORIGINS}
|
||||
networks:
|
||||
- file-transformer-network
|
||||
depends_on:
|
||||
- postgres
|
||||
- minio
|
||||
|
||||
# File Upload Function (local development)
|
||||
function-upload:
|
||||
build:
|
||||
context: ./functions/upload
|
||||
dockerfile: Dockerfile
|
||||
container_name: file-transformer-upload-function
|
||||
ports:
|
||||
- "5001:5000"
|
||||
environment:
|
||||
- MINIO_ENDPOINT=${MINIO_ENDPOINT}
|
||||
- MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY}
|
||||
- MINIO_SECRET_KEY=${MINIO_SECRET_KEY}
|
||||
- MINIO_BUCKET_NAME=${MINIO_BUCKET_NAME}
|
||||
- POSTGRES_URL=${POSTGRES_URL}
|
||||
networks:
|
||||
- file-transformer-network
|
||||
depends_on:
|
||||
- postgres
|
||||
- minio
|
||||
|
||||
# File Transform Function (local development)
|
||||
function-transform:
|
||||
build:
|
||||
context: ./functions/transform
|
||||
dockerfile: Dockerfile
|
||||
container_name: file-transformer-transform-function
|
||||
ports:
|
||||
- "5002:5000"
|
||||
environment:
|
||||
- MINIO_ENDPOINT=${MINIO_ENDPOINT}
|
||||
- MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY}
|
||||
- MINIO_SECRET_KEY=${MINIO_SECRET_KEY}
|
||||
- MINIO_BUCKET_NAME=${MINIO_BUCKET_NAME}
|
||||
- POSTGRES_URL=${POSTGRES_URL}
|
||||
networks:
|
||||
- file-transformer-network
|
||||
depends_on:
|
||||
- postgres
|
||||
- minio
|
||||
|
||||
# File Download Function (local development)
|
||||
function-download:
|
||||
build:
|
||||
context: ./functions/download
|
||||
dockerfile: Dockerfile
|
||||
container_name: file-transformer-download-function
|
||||
ports:
|
||||
- "5003:5000"
|
||||
environment:
|
||||
- MINIO_ENDPOINT=${MINIO_ENDPOINT}
|
||||
- MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY}
|
||||
- MINIO_SECRET_KEY=${MINIO_SECRET_KEY}
|
||||
- MINIO_BUCKET_NAME=${MINIO_BUCKET_NAME}
|
||||
- POSTGRES_URL=${POSTGRES_URL}
|
||||
networks:
|
||||
- file-transformer-network
|
||||
depends_on:
|
||||
- postgres
|
||||
- minio
|
||||
|
||||
# File Metadata Function (local development)
|
||||
function-metadata:
|
||||
build:
|
||||
context: ./functions/metadata
|
||||
dockerfile: Dockerfile
|
||||
container_name: file-transformer-metadata-function
|
||||
ports:
|
||||
- "5004:5000"
|
||||
environment:
|
||||
- MINIO_ENDPOINT=${MINIO_ENDPOINT}
|
||||
- MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY}
|
||||
- MINIO_SECRET_KEY=${MINIO_SECRET_KEY}
|
||||
- MINIO_BUCKET_NAME=${MINIO_BUCKET_NAME}
|
||||
- POSTGRES_URL=${POSTGRES_URL}
|
||||
networks:
|
||||
- file-transformer-network
|
||||
depends_on:
|
||||
- postgres
|
||||
- minio
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
driver: local
|
||||
minio_data:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
file-transformer-network:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user