-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
63 lines (61 loc) · 2.18 KB
/
docker-compose.yml
File metadata and controls
63 lines (61 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Docker Compose for local development
# Uses real AWS services (dev environment) for testing before deployment
#
# Prerequisites:
# 1. AWS credentials configured (~/.aws/credentials or environment variables)
# 2. Infrastructure deployed to dev environment (terraform apply)
# 3. Copy .env.example to .env and fill in values from terraform output
#
# Usage:
# docker-compose up # Start API only
# docker-compose --profile training run training # Run training job
#
# Frontend: Run natively with pnpm (see frontend/README.md)
# cd frontend && pnpm dev
#
# For training, set environment variables inline:
# DATASET_ID=xxx TARGET_COLUMN=price docker-compose --profile training run training
services:
# Backend API - connects to AWS dev environment
api:
build:
context: ./backend
dockerfile: Dockerfile.api
container_name: automl-api
ports:
- "8000:8000"
env_file:
- ./backend/.env
environment:
- AWS_PROFILE=${AWS_PROFILE:-default}
# Map AWS_REGION to REGION for training container compatibility
- REGION=${AWS_REGION:-us-east-1}
volumes:
- ./backend/api:/app/api:ro
- ~/.aws:/root/.aws:ro # Mount AWS credentials
# Required for ONNX Runtime in Docker (development only)
# Lambda doesn't need this - works natively
privileged: true
command: uvicorn api.main:app --host 0.0.0.0 --port 8000 --reload
# Training Container - same image used by AWS Batch
# Run manually: docker-compose --profile training run training
training:
build:
context: ./backend/training
dockerfile: Dockerfile
container_name: automl-training
profiles:
- training # Only runs when explicitly called with --profile training
env_file:
- ./backend/.env
environment:
- AWS_PROFILE=${AWS_PROFILE:-default}
# Map AWS_REGION to REGION for train.py compatibility
- REGION=${AWS_REGION:-us-east-1}
# These must be set when running (inline):
- DATASET_ID=${DATASET_ID:-}
- TARGET_COLUMN=${TARGET_COLUMN:-}
- JOB_ID=${JOB_ID:-local-test}
- TIME_BUDGET=${TIME_BUDGET:-60}
volumes:
- ~/.aws:/root/.aws:ro # Mount AWS credentials