-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathcompose.yml
More file actions
106 lines (95 loc) · 2.78 KB
/
compose.yml
File metadata and controls
106 lines (95 loc) · 2.78 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
102
103
104
105
106
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: mydia_dev
ports:
- "5433:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
profiles:
- postgres
app:
image: mydia-app:latest
build:
context: .
dockerfile: Dockerfile.dev
container_name: mydia_dev
environment:
# User mapping for host filesystem permissions
# Set via ./dev script to match host user
LOCAL_UID: ${LOCAL_UID:-0}
LOCAL_GID: ${LOCAL_GID:-0}
# Phoenix configuration
PHX_HOST: localhost
PORT: 4000
SECRET_KEY_BASE: "VlPUd2fbnWjh6Di+7SGc2SSXpNhI0hN766FFAlct65wU5ARyiGvK9r3TqSqKyu0K"
# Database configuration (SQLite)
DATABASE_PATH: /app/mydia_dev.db
# Mix environment
MIX_ENV: dev
# Rust logging for p2p NIF
RUST_LOG: info
# Metadata relay configuration
METADATA_RELAY_URL: ${METADATA_RELAY_URL:-https://relay.mydia.dev}
# P2P bind port for direct connections (iroh hole punching)
# Must match the exposed UDP port below
P2P_BIND_PORT: 4000
# For interactive debugging
MIX_HOME: /app/.mix
HEX_HOME: /app/.hex
# Flutter cache
PUB_CACHE: /app/player/.pub-cache
network_mode: host
volumes:
# Mount source code for live reloading
- .:/app
# Persist build artifacts and dependencies across restarts
- build_cache:/app/_build
- deps_cache:/app/deps
- mix_cache:/app/.mix
- hex_cache:/app/.hex
- node_modules:/app/assets/node_modules
# Persist NIF cache to avoid redownloading/recompiling on every run
- elixir_make_cache:/root/.cache/elixir_make
# Persist Flutter pub cache
- player_pub_cache:/app/player/.pub-cache
# Isolate Flutter environment-specific directories from host (nix develop)
# These contain SDK-specific artifacts that conflict between environments
- player_dart_tool:/app/player/.dart_tool
- player_build:/app/player/build
stdin_open: true
tty: true
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4000"]
interval: 30s
timeout: 3s
start_period: 40s
retries: 3
volumes:
player_pub_cache:
driver: local
# Flutter environment isolation (prevents conflicts with nix develop)
player_dart_tool:
driver: local
player_build:
driver: local
# Named volumes for caching
build_cache:
driver: local
deps_cache:
driver: local
mix_cache:
driver: local
hex_cache:
driver: local
node_modules:
driver: local
elixir_make_cache:
driver: local
# PostgreSQL data (only used with --profile postgres)
postgres_data:
driver: local