-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
56 lines (54 loc) · 1.64 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
56 lines (54 loc) · 1.64 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
services:
db:
image: postgres:16-alpine
container_name: portfolio-postgres-dev
restart: unless-stopped
ports:
- "5432:5432"
environment:
POSTGRES_DB: portfolio
POSTGRES_USER: portfolio
POSTGRES_PASSWORD: portfolio
volumes:
- dev-postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U portfolio -d portfolio"]
interval: 10s
timeout: 5s
retries: 5
web:
build:
context: .
dockerfile: Dockerfile.dev
image: portfolio:dev
container_name: portfolio-dev
ports:
- "3000:3000"
environment:
- NODE_ENV=development
- NEXT_TELEMETRY_DISABLED=1
- CHOKIDAR_USEPOLLING=true
- WATCHPACK_POLLING=true
- NEXT_PUBLIC_SITE_URL=http://localhost:3000
- DATABASE_URL=postgres://portfolio:portfolio@db:5432/portfolio
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN:-}
- TELEGRAM_CHAT_ID=${TELEGRAM_CHAT_ID:-}
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:3000/ >/dev/null && wget -qO- http://127.0.0.1:3000/gallery >/dev/null"]
interval: 30s
timeout: 60s
retries: 5
start_period: 3s
volumes:
# Bind the source, but keep node_modules and .next inside the container
# so the host OS doesn't clobber platform-specific binaries.
- .:/app
- node-modules:/app/node_modules
- /app/.next
command: sh -ec "test -d node_modules/next -a -d node_modules/drizzle-orm || npm ci; npm run db:migrate; npm run dev:docker"
volumes:
dev-postgres-data:
node-modules: