31 lines
638 B
YAML
31 lines
638 B
YAML
---
|
|
|
|
- name: Setup volume
|
|
community.docker.docker_volume:
|
|
name: pg_data
|
|
|
|
|
|
- name: Setup docker container
|
|
community.docker.docker_container:
|
|
name: bright
|
|
image: postgres:16
|
|
pull: missing
|
|
state: started
|
|
ports:
|
|
- "5432:5432"
|
|
env:
|
|
POSTGRES_USER: "postgres"
|
|
POSTGRES_DB: "bright"
|
|
POSTGRES_PASSWORD: "{{ lookup('dotenv', 'DB_PASS', file='../.env') }}"
|
|
mounts:
|
|
- type: volume
|
|
target: "/var/lib/postgresql/data"
|
|
source: "pg_data"
|
|
|
|
- name: Allow VPC2.0 network access
|
|
community.general.ufw:
|
|
rule: allow
|
|
port: '5432'
|
|
proto: tcp
|
|
from: 10.2.128.0/20
|