-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
101 lines (92 loc) · 2.85 KB
/
docker-compose.yml
File metadata and controls
101 lines (92 loc) · 2.85 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
version: '3.8'
services:
terradev-cli:
build: .
image: theoddden/terradev-cli:2.9.2
container_name: terradev-cli
environment:
- TERRADEV_API_URL=https://api.terradev.cloud
- TERRADEV_FALLBACK_URL=http://34.207.59.52:8080
volumes:
- ~/.aws:/home/terradev/.aws:ro
- ~/.gcp:/home/terradev/.gcp:ro
- ~/.azure:/home/terradev/.azure:ro
- ./config:/home/terradev/.terradev
ports:
- "8000:8000"
- "8080:8080"
- "8888:8888"
command: python -m terradev_cli status
restart: unless-stopped
terradev-jupyter:
build: .
image: theoddden/terradev-cli:2.9.2
container_name: terradev-jupyter
environment:
- TERRADEV_API_URL=https://api.terradev.cloud
- TERRADEV_FALLBACK_URL=http://34.207.59.52:8080
volumes:
- ./notebooks:/home/terradev/notebooks
- ~/.aws:/home/terradev/.aws:ro
- ~/.gcp:/home/terradev/.gcp:ro
- ~/.azure:/home/terradev/.azure:ro
- ./config:/home/terradev/.terradev
ports:
- "8888:8888"
command: >
bash -c "
pip install jupyterlab &&
jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --allow-root --NotebookApp.token='' --NotebookApp.password=''
"
restart: unless-stopped
terradev-api:
build: .
image: theoddden/terradev-cli:2.9.2
container_name: terradev-api
environment:
- TERRADEV_API_URL=https://api.terradev.cloud
- TERRADEV_FALLBACK_URL=http://34.207.59.52:8080
- FLASK_ENV=production
volumes:
- ~/.aws:/home/terradev/.aws:ro
- ~/.gcp:/home/terradev/.gcp:ro
- ~/.azure:/home/terradev/.azure:ro
- ./config:/home/terradev/.terradev
ports:
- "8080:8080"
command: >
bash -c "
pip install flask &&
python -c '
from flask import Flask, jsonify
import subprocess
import json
app = Flask(__name__)
@app.route(\"/health\")
def health():
return jsonify({\"status\": \"healthy\"})
@app.route(\"/quote/<gpu_type>\")
def quote(gpu_type):
try:
result = subprocess.run([\"python\", \"-m\", \"terradev_cli\", \"quote\", \"-g\", gpu_type],
capture_output=True, text=True)
return jsonify({\"gpu_type\": gpu_type, \"output\": result.stdout})
except Exception as e:
return jsonify({\"error\": str(e)}), 500
app.run(host=\"0.0.0.0\", port=8080)
'
"
restart: unless-stopped
postgres:
image: postgres:15-alpine
environment:
POSTGRES_DB: terradev
POSTGRES_USER: terradev
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
restart: unless-stopped
volumes:
postgres_data: