-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
87 lines (80 loc) · 2.06 KB
/
docker-compose.yaml
File metadata and controls
87 lines (80 loc) · 2.06 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
# For DEVELOPMENT environment
volumes:
app_db_dev_data:
networks:
app-network:
driver: bridge
services:
# Development database
app-db-dev:
image: pgvector/pgvector:pg16
container_name: app-db-dev
restart: unless-stopped
environment:
POSTGRES_USER: dev_user
POSTGRES_PASSWORD: dev_password
POSTGRES_DB: heaters_dev_db
volumes:
- app_db_dev_data:/var/lib/postgresql/data
ports:
- "5433:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U dev_user -d heaters_dev_db" ]
interval: 5s
timeout: 3s
retries: 10
start_period: 30s
networks:
- app-network
# Main application service for development
app:
build:
context: .
dockerfile: Dockerfile.dev
container_name: heaters-app-dev
env_file: .env
dns:
- 8.8.8.8
- 8.8.4.4
- 1.1.1.1
environment:
MIX_ENV: dev
APP_ENV: development
PHX_HOST: localhost
DOCKER_ENV: "true"
DEV_DATABASE_URL: ${DEV_DATABASE_URL}
DEV_S3_BUCKET_NAME: ${DEV_S3_BUCKET_NAME}
DEV_CLOUDFRONT_DOMAIN: ${DEV_CLOUDFRONT_DOMAIN}
# Resource limits to prevent OOM kills during video processing
# To monitor: docker stats heaters-app-dev
# To check logs: docker logs heaters-app-dev -f
deploy:
resources:
limits:
memory: 4G # Adjust based on your system RAM
reservations:
memory: 2G
volumes:
- ./:/app
- ./priv/fixtures:/fixtures:ro # Mount local proxy files for dev testing
command: >
sh -c "
if [ ! -d deps ] || [ -z \"$(ls -A deps 2>/dev/null)\" ]; then
mix deps.get;
fi &&
if [ ! -d assets/node_modules ] || [ -z \"$(ls -A assets/node_modules 2>/dev/null)\" ]; then
bun install --cwd assets;
fi &&
mix ecto.create &&
mix ecto.migrate &&
mix phx.server
"
ports:
- "4002:4002"
depends_on:
app-db-dev:
condition: service_healthy
networks:
- app-network
tty: true
stdin_open: true