refactor docker-compose.yaml
This commit is contained in:
@@ -1,6 +1,24 @@
|
|||||||
version: '3.8'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
db:
|
||||||
|
image: postgres:latest
|
||||||
|
restart: always
|
||||||
|
user: postgres
|
||||||
|
volumes:
|
||||||
|
- db-data:/var/lib/postgresql/data
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: ${PG_USER}
|
||||||
|
POSTGRES_DB: ${PG_DATABASE}
|
||||||
|
POSTGRES_PASSWORD: ${PG_PASSWORD}
|
||||||
|
expose:
|
||||||
|
- ${PG_PORT}
|
||||||
|
healthcheck:
|
||||||
|
test: [ "CMD", "pg_isready", "-U", "${PG_USER}" ]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
web-chat:
|
web-chat:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
@@ -18,22 +36,5 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
|
|
||||||
db:
|
|
||||||
image: postgres:latest
|
|
||||||
restart: always
|
|
||||||
user: postgres
|
|
||||||
volumes:
|
|
||||||
- db-data:/var/lib/postgresql/data
|
|
||||||
environment:
|
|
||||||
POSTGRES_USER: ${PG_USER}
|
|
||||||
POSTGRES_DB: ${PG_DATABASE}
|
|
||||||
POSTGRES_PASSWORD: ${PG_PASSWORD}
|
|
||||||
expose:
|
|
||||||
- ${PG_PORT}
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "pg_isready", "-U", "${PG_USER}"]
|
|
||||||
interval: 10s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 5
|
|
||||||
volumes:
|
volumes:
|
||||||
db-data:
|
db-data:
|
||||||
|
|||||||
Reference in New Issue
Block a user