Files
homelab/tasks/postgres.yml
Matthew McKinnon 6208f61652
All checks were successful
Deploy / Prepare Build (push) Successful in 24m50s
chore: update container image
2025-10-15 20:05:45 +10:00

24 lines
481 B
YAML

---
- name: Create directories
file:
path: "{{ item }}"
state: directory
with_items:
- "/data/postgres"
- "/data/postgres/data"
- name: Create the postgres container
docker_container:
name: postgres
image: postgres:17.0-alpine
restart_policy: unless-stopped
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: "{{POSTGRES_PASSWORD}}"
volumes:
- /data/postgres/data:/var/lib/postgresql/data
pull: true
recreate: true