Newer
Older
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
49
50
51
52
53
54
55
services:
app:
container_name: ${CONTAINER_NAME}-app
build:
context: ./
dockerfile: ./docker/app/Dockerfile
target: app
args:
COMPOSER_AUTH: "{}"
APP_BASE_DIR: ${APP_BASE_DIR-.}
depends_on:
db:
condition: service_healthy
restart: unless-stopped
extra_hosts:
- "host.docker.internal:host-gateway"
web:
container_name: ${CONTAINER_NAME}-web
build:
context: ./
dockerfile: ./docker/web/Dockerfile
target: web
args:
APP_BASE_DIR: ${APP_BASE_DIR-.}
restart: unless-stopped
ports:
- ${HTTP_PORT}:8080
environment:
PHP_FPM_HOST: app
depends_on:
app:
condition: service_healthy
db:
container_name: ${CONTAINER_NAME}-db
image: postgres:16-alpine3.18
environment:
USER_ID: ${USER_ID}
GROUP_ID: ${GROUP_ID}
PGDATA: /data/postgres
PGUSER: ${DB_ROOT_USERNAME}
POSTGRES_DB: ${DB_DATABASE}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- sqldata:/data/postgres
restart: unless-stopped
healthcheck:
test: [ "CMD-SHELL", "pg_isready", "-d" ]
timeout: 5s
retries: 3
volumes:
sqldata: