33 lines
594 B
YAML
33 lines
594 B
YAML
|
version: '3.8'
|
||
|
services:
|
||
|
postgres:
|
||
|
image: postgres:latest
|
||
|
container_name: postgres
|
||
|
environment:
|
||
|
POSTGRES_USER: user
|
||
|
POSTGRES_PASSWORD: password
|
||
|
POSTGRES_DB: mydatabase
|
||
|
ports:
|
||
|
- "5432:5432"
|
||
|
volumes:
|
||
|
- postgres_data:/var/lib/postgresql/data
|
||
|
networks:
|
||
|
- mynetwork
|
||
|
|
||
|
app:
|
||
|
build: .
|
||
|
container_name: app
|
||
|
environment:
|
||
|
DATABASE_URL: "postgresql://user:password@postgres:5432/mydatabase"
|
||
|
depends_on:
|
||
|
- postgres
|
||
|
networks:
|
||
|
- mynetwork
|
||
|
|
||
|
networks:
|
||
|
mynetwork:
|
||
|
driver: bridge
|
||
|
|
||
|
volumes:
|
||
|
postgres_data:
|