-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
46 lines (43 loc) · 1.1 KB
/
docker-compose.yml
File metadata and controls
46 lines (43 loc) · 1.1 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
services:
test-postgres:
image: postgres:16-alpine
container_name: test-postgres
env_file:
- .env
environment:
POSTGRES_DB: ${DB_DATABASE:-db}
POSTGRES_USER: ${DB_USERNAME:-guest}
POSTGRES_PASSWORD: ${DB_PASSWORD:-guest}
PGDATA: /var/lib/postgresql/data/pgdata
ports:
- "${DB_PORT:-5432}:5432"
volumes:
- test-postgres-data:/var/lib/postgresql/data
networks:
- test-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME:-guest}"]
interval: 10s
timeout: 10s
retries: 3
test-backend:
build: .
container_name: test-backend
working_dir: /var/www/html
volumes:
- ./:/var/www/html
ports:
- "${APP_PORT:-8000}:8000"
depends_on:
test-postgres:
condition: service_healthy
networks:
- test-network
env_file:
- .env
command: sh -c "php artisan config:clear && php artisan cache:clear && php artisan migrate:fresh && php artisan serve --host=0.0.0.0 --port=8000"
volumes:
test-postgres-data:
networks:
test-network:
driver: bridge