-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
52 lines (49 loc) · 1.48 KB
/
docker-compose.yml
File metadata and controls
52 lines (49 loc) · 1.48 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
version: "3.8"
services:
# ---------------------------------------------------------------------------
# MongoDB — local development database
# ---------------------------------------------------------------------------
mongodb:
image: mongo:7
container_name: stemly-mongo
restart: unless-stopped
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: stemly
MONGO_INITDB_ROOT_PASSWORD: stemly_dev
MONGO_INITDB_DATABASE: stemly
volumes:
- mongo-data:/data/db
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
# ---------------------------------------------------------------------------
# FastAPI backend
# ---------------------------------------------------------------------------
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: stemly-backend
restart: unless-stopped
ports:
- "8000:8000"
env_file:
- ./backend/.env
environment:
# Override MONGO_URI to point to the container
MONGO_URI: mongodb://stemly:stemly_dev@mongodb:27017/stemly?authSource=admin
volumes:
# Mount source code for hot reload
- ./backend:/app
# Prevent overwriting container's venv
- /app/.venv
depends_on:
mongodb:
condition: service_healthy
command: uvicorn main:app --host 0.0.0.0 --port 8000 --reload
volumes:
mongo-data: