-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.postgres.yml
More file actions
47 lines (43 loc) · 1.33 KB
/
docker-compose.postgres.yml
File metadata and controls
47 lines (43 loc) · 1.33 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
# PostgreSQL override for Skymmich
#
# Layer this on top of the base compose file to use PostgreSQL instead of SQLite:
# docker compose -f docker-compose.yml -f docker-compose.postgres.yml up -d
# docker compose -f docker-compose.prod.yml -f docker-compose.postgres.yml up -d
#
# Requires POSTGRES_PASSWORD set in .env or environment:
# echo "POSTGRES_PASSWORD=your_secure_password" > .env
services:
skymmich:
environment:
- DATABASE_URL=postgresql://skymmich:${POSTGRES_PASSWORD}@skymmich-db:5432/skymmich
depends_on:
skymmich-db:
condition: service_healthy
networks:
- skymmich-network
skymmich-db:
image: postgres:15-alpine
container_name: skymmich-db
restart: unless-stopped
environment:
- POSTGRES_DB=skymmich
- POSTGRES_USER=skymmich
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C
volumes:
- skymmich-database:/var/lib/postgresql/data
networks:
- skymmich-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U skymmich -d skymmich"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
# Don't expose PostgreSQL port externally for security
networks:
skymmich-network:
driver: bridge
volumes:
skymmich-database:
driver: local