Docker-Compose with App and DB Service
This commit is contained in:
@@ -8,9 +8,16 @@ services:
|
||||
DATABASE_URL: "postgresql://user:password@db:5432/urlshort"
|
||||
depends_on:
|
||||
- db
|
||||
networks: backend
|
||||
networks:
|
||||
backend:
|
||||
driver: Bridge
|
||||
|
||||
volumes:
|
||||
db_data:
|
||||
|
||||
db:
|
||||
image: postgres:16
|
||||
image: postgres:alpine
|
||||
container_name: url_db
|
||||
restart: always
|
||||
environment:
|
||||
@@ -19,6 +26,4 @@ services:
|
||||
POSTGRES_DB: urlshort
|
||||
volumes:
|
||||
- db_data:/var/lib/postgresql/data
|
||||
|
||||
volumes:
|
||||
db_data:
|
||||
networks: backend
|
||||
|
||||
Reference in New Issue
Block a user