-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
48 lines (46 loc) · 1.35 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
services:
# PHP service
php:
container_name: inventory-sender
build:
context: .
target: php
args:
- APP_ENV=${APP_ENV}
environment:
- APP_ENV=${APP_ENV}
volumes:
- ./:/app
ports:
- ${APP_PORT:-80}:8080
networks:
- inventory-sender
depends_on:
database:
condition: service_healthy
restart: always
# Database service
database:
container_name: inventory-sender-database
image: postgres:16.3
ports:
- ${FORWARD_DB_PORT:-5432}:5432
environment:
- POSTGRES_DB=${DB_DATABASE}
- POSTGRES_USER=${DB_USERNAME}
- POSTGRES_PASSWORD=${DB_PASSWORD}
volumes:
- inventory-sender-database:/var/lib/postgresql/data
networks:
- inventory-sender
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME} -d ${DB_DATABASE}"]
interval: 3s # Check every x seconds
timeout: 2s # Timeout if it takes longer than x seconds
retries: 5 # Mark unhealthy after 3 consecutive failures
restart: always
networks:
inventory-sender:
driver: bridge
volumes:
inventory-sender-database: ~