demo for compose
This commit is contained in:
28
docker-compose.yaml
Normal file
28
docker-compose.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
services:
|
||||
db:
|
||||
image: postgres:15-alpine
|
||||
env_file:
|
||||
- ./.env
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- ./postgres_data:/var/lib/postgresql/data
|
||||
container_name: postgres_db
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: [ "CMD-SHELL", "pg_isready", "-d", "db_prod" ]
|
||||
interval: 30s
|
||||
timeout: 60s
|
||||
retries: 5
|
||||
start_period: 80s
|
||||
web:
|
||||
ports:
|
||||
- "80:8086"
|
||||
build:
|
||||
context: ./src
|
||||
env_file:
|
||||
- ./.env
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
restart: always
|
||||
Reference in New Issue
Block a user