Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
73 lines (69 loc) · 1.78 KB
/
Copy pathdocker-compose.yml
File metadata and controls
73 lines (69 loc) · 1.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
services:
# Database
postgres:
image: postgres:17-alpine
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
POSTGRES_DB: ${POSTGRES_DB:-lcm-nextjs-boilerplate}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "${POSTGRES_PORT:-5732}:5432"
networks:
- lcm-nextjs-boilerplate
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
interval: 10s
timeout: 5s
retries: 5
# Email testing
mailhog:
image: mailhog/mailhog:latest
platform: linux/amd64
restart: unless-stopped
ports:
- "${MAILHOG_SMTP_PORT:-1025}:1025"
- "${MAILHOG_WEB_PORT:-8025}:8025"
networks:
- lcm-nextjs-boilerplate
healthcheck:
test:
[
"CMD",
"wget",
"--quiet",
"--tries=1",
"--spider",
"http://localhost:8025",
]
interval: 30s
timeout: 10s
retries: 3
# Next.js application (for production)
app:
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
environment:
- NODE_ENV=production
- DATABASE_URL=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-password}@postgres:5432/${POSTGRES_DB:-lcm-nextjs-boilerplate}
- AUTH_SECRET=${AUTH_SECRET}
- AUTH_URL=${AUTH_URL:-http://localhost:3000}
- NEXT_PUBLIC_BASE_URL=${NEXT_PUBLIC_BASE_URL:-http://localhost:3000}
ports:
- "${APP_PORT:-3000}:3000"
depends_on:
postgres:
condition: service_healthy
networks:
- lcm-nextjs-boilerplate
profiles:
- production
volumes:
postgres_data:
networks:
lcm-nextjs-boilerplate:
driver: bridge