-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
56 lines (46 loc) · 1.09 KB
/
docker-compose.yml
File metadata and controls
56 lines (46 loc) · 1.09 KB
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
56
services:
php:
build:
context: .
dockerfile: Dockerfile
args:
PHP_VERSION: ${PHP_VERSION:-8.1}
COMPOSER_VERSION: ${COMPOSER_VERSION:-2.9.2}
USER_ID: ${USER_ID:-1000}
GROUP_ID: ${GROUP_ID:-1000}
XDEBUG_MODE: ${XDEBUG_MODE:-off}
container_name: php-dev
hostname: php-dev
# Keep container running
tty: true
stdin_open: true
# Volumes
volumes:
# Mount your project directory
- ./:/app:delegated
# Persist composer cache
- composer-cache:/home/app/.composer
# Optional: persist bash history
- bash-history:/home/app
# Environment variables
env_file:
- .env
# Health check
healthcheck:
test: ["CMD", "php", "-v"]
interval: 30s
timeout: 3s
retries: 3
start_period: 5s
# Restart policy
restart: unless-stopped
# Working directory
working_dir: /app
# Named volumes for persistence
volumes:
composer-cache:
driver: local
name: php-composer-cache
bash-history:
driver: local
name: php-bash-history