-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.dev.yaml
More file actions
60 lines (56 loc) · 1.88 KB
/
docker-compose.dev.yaml
File metadata and controls
60 lines (56 loc) · 1.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
version: '3.8'
services:
# mysql:
# image: mysql:8.0
# container_name: webmi_mysql
# restart: unless-stopped
# environment:
# # Use environment variable values when provided, otherwise fall back to safe local defaults
# MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-local_root_password}
# MYSQL_DATABASE: ${MYSQL_DATABASE:-devdb}
# MYSQL_USER: ${MYSQL_USER:-devuser}
# MYSQL_PASSWORD: ${MYSQL_PASSWORD:-devpass}
# volumes:
# - mysql_data:/var/lib/mysql
# ports:
# # Maps host port (default 3306) to container 3306. Change MYSQL_HOST_PORT to avoid conflicts.
# - '${MYSQL_HOST_PORT:-3306}:3306'
# healthcheck:
# # Uses mysqladmin inside the container to report readiness
# test: ['CMD', 'mysqladmin', 'ping', '-h', 'localhost', '-uroot', '-p${MYSQL_ROOT_PASSWORD}']
# interval: 10s
# timeout: 5s
# retries: 5
# start_period: 30s
# networks:
# - webmi_default
postgres:
image: postgres:16
container_name: webmi_postgres
restart: unless-stopped
environment:
# PostgreSQL environment variables
POSTGRES_DB: ${POSTGRES_DATABASE:-devdb}
POSTGRES_USER: ${POSTGRES_USER:-devdb}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-local_root_password}
POSTGRES_INITDB_ARGS: '--encoding=UTF8 --locale=en_US.UTF-8'
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
# Maps host port (default 5432) to container 5432. Change POSTGRES_HOST_PORT to avoid conflicts.
- '${POSTGRES_HOST_PORT:-5432}:5432'
healthcheck:
# Uses pg_isready to check database readiness
test: ['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER:-devdb}']
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
networks:
- webmi_default
volumes:
mysql_data:
postgres_data:
networks:
webmi_default:
driver: bridge