-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
84 lines (65 loc) · 2.17 KB
/
Copy pathdocker-compose.yml
File metadata and controls
84 lines (65 loc) · 2.17 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
# Docker Compose configuration for SusCommunity PostgreSQL database
# This sets up a containerized PostgreSQL instance for development and production
version: '3.8'
services:
postgres:
image: postgis/postgis:15-3.4
container_name: suscommunity-postgres
restart: unless-stopped
environment:
# Database credentials - CHANGE THESE IN PRODUCTION!
POSTGRES_DB: suscommunity
POSTGRES_USER: suscommunity_user
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-change_me_in_production}
# PostgreSQL configuration
POSTGRES_INITDB_ARGS: "-E UTF8 --locale=en_US.UTF-8"
ports:
# Map PostgreSQL port to host
- "${POSTGRES_PORT:-5432}:5432"
volumes:
# Persist database data
- postgres_data:/var/lib/postgresql/data
# Mount initialization scripts
- ./server/database/init:/docker-entrypoint-initdb.d
# Mount custom PostgreSQL configuration (optional)
# - ./server/database/postgresql.conf:/etc/postgresql/postgresql.conf
networks:
- suscommunity-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U suscommunity_user -d suscommunity"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
# pgAdmin - Web UI for PostgreSQL management (optional, for development)
pgadmin:
image: dpage/pgadmin4:latest
container_name: suscommunity-pgadmin
restart: unless-stopped
profiles:
- tools # Only start when explicitly requested: docker-compose --profile tools up
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_EMAIL:-admin@suscommunity.local}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_PASSWORD:-admin}
PGADMIN_CONFIG_SERVER_MODE: 'False'
PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: 'False'
ports:
- "${PGADMIN_PORT:-5050}:80"
volumes:
- pgadmin_data:/var/lib/pgadmin
networks:
- suscommunity-network
depends_on:
postgres:
condition: service_healthy
volumes:
postgres_data:
driver: local
name: suscommunity_postgres_data
pgadmin_data:
driver: local
name: suscommunity_pgadmin_data
networks:
suscommunity-network:
driver: bridge
name: suscommunity-network