1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
services:
postgres:
image: postgres:latest
container_name: my_postgres
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-mysecretpassword}
- POSTGRES_DB=${POSTGRES_DB:-mydatabase}
- POSTGRES_USER=${POSTGRES_USER:-postgres}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
restart: unless-stopped
volumes:
postgres_data:
name: postgres_data
|