-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
126 lines (116 loc) · 2.88 KB
/
docker-compose.yml
File metadata and controls
126 lines (116 loc) · 2.88 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# Docker Compose configuration for local development
# https://docs.docker.com/compose/
services:
# Application service
app:
build:
context: .
dockerfile: Dockerfile
target: development
ports:
- '3000:3000'
volumes:
- .:/app
- /app/node_modules
environment:
- NODE_ENV=development
- DATABASE_URL=postgresql://postgres:postgres@db:5432/app_dev
- REDIS_URL=redis://redis:6379
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
command: npm run dev
# PostgreSQL database
db:
image: postgres:16-alpine
ports:
- '5432:5432'
volumes:
- postgres_data:/var/lib/postgresql/data
- ./scripts/init-db.sql:/docker-entrypoint-initdb.d/init.sql:ro
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: app_dev
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 10s
timeout: 5s
retries: 5
# Redis cache
redis:
image: redis:7-alpine
ports:
- '6379:6379'
volumes:
- redis_data:/data
command: redis-server --appendonly yes
# Alternative: MySQL database
# mysql:
# image: mysql:8.0
# ports:
# - '3306:3306'
# volumes:
# - mysql_data:/var/lib/mysql
# environment:
# MYSQL_ROOT_PASSWORD: root
# MYSQL_DATABASE: app_dev
# MYSQL_USER: app
# MYSQL_PASSWORD: password
# healthcheck:
# test: ['CMD', 'mysqladmin', 'ping', '-h', 'localhost']
# interval: 10s
# timeout: 5s
# retries: 5
# Alternative: MongoDB database
# mongodb:
# image: mongo:7
# ports:
# - '27017:27017'
# volumes:
# - mongodb_data:/data/db
# environment:
# MONGO_INITDB_ROOT_USERNAME: root
# MONGO_INITDB_ROOT_PASSWORD: password
# MONGO_INITDB_DATABASE: app_dev
# Alternative: Elasticsearch
# elasticsearch:
# image: docker.elastic.co/elasticsearch/elasticsearch:8.15.0
# ports:
# - '9200:9200'
# volumes:
# - elasticsearch_data:/usr/share/elasticsearch/data
# environment:
# - discovery.type=single-node
# - xpack.security.enabled=false
# - ES_JAVA_OPTS=-Xms512m -Xmx512m
# Alternative: MinIO (S3-compatible storage)
# minio:
# image: minio/minio:latest
# ports:
# - '9000:9000'
# - '9001:9001'
# volumes:
# - minio_data:/data
# environment:
# MINIO_ROOT_USER: minioadmin
# MINIO_ROOT_PASSWORD: minioadmin
# command: server /data --console-address ":9001"
# Alternative: Mailpit (email testing)
# mailpit:
# image: axllent/mailpit:latest
# ports:
# - '1025:1025'
# - '8025:8025'
volumes:
postgres_data:
redis_data:
# mysql_data:
# mongodb_data:
# elasticsearch_data:
# minio_data:
networks:
default:
name: app-network