-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
72 lines (68 loc) · 1.73 KB
/
docker-compose.yml
File metadata and controls
72 lines (68 loc) · 1.73 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
services:
# Development environment
app:
build:
context: .
dockerfile: Dockerfile
target: ${BUILD_TARGET:-development}
container_name: laravel-app-${BUILD_TARGET:-development}
restart: unless-stopped
working_dir: /var/www
volumes:
- ./:/var/www
ports:
- "${WEBSERVER_PORT}:80"
networks:
- laravel-network
depends_on:
postgres:
condition: service_healthy
# Remove Redis dependency for now to test
# redis:
# condition: service_started
# elasticsearch:
# condition: service_healthy
environment:
- APP_ENV=${APP_ENV}
- DB_HOST=postgres
# - REDIS_HOST=redis
# - ELASTICSEARCH_HOST=elasticsearch
# Database
postgres:
image: postgres:16-alpine
container_name: postgres
restart: unless-stopped
environment:
POSTGRES_DB: ${DB_DATABASE:-laravel}
POSTGRES_USER: ${DB_USERNAME:-root}
POSTGRES_PASSWORD: ${DB_PASSWORD:-password}
POSTGRES_INITDB_ARGS: --encoding=UTF-8
volumes:
- postgres_data:/var/lib/postgresql/data
- ./docker/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- "${DB_PORT}:5432"
networks:
- laravel-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME:-postgres} -d ${DB_DATABASE:-laravel}"]
interval: 10s
timeout: 5s
retries: 5
# Adminer (Lightweight database management)
adminer:
image: adminer:4.8.1
container_name: adminer
restart: unless-stopped
ports:
- "${ADMINER_PORT}:8080"
networks:
- laravel-network
depends_on:
- postgres
networks:
laravel-network:
driver: bridge
volumes:
postgres_data:
driver: local