-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
90 lines (84 loc) · 2.06 KB
/
docker-compose.yml
File metadata and controls
90 lines (84 loc) · 2.06 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
services:
nginx:
image: nginx:1.27-alpine
container_name: laravel_nginx
restart: unless-stopped
tty: true
ports:
- "8999:80"
volumes:
- ./src:/app
- ./docker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- php
networks:
- laravel
php:
build:
context: ./docker/php
dockerfile: Dockerfile
container_name: laravel_php
restart: unless-stopped
volumes:
- ./src:/app
- ./docker/php/www.conf:/usr/local/etc/php-fpm.d/www.conf:rw
- ./docker/php/php.ini:/usr/local/etc/php/conf.d/custom.ini:rw
user: "1000:0"
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "3"
extra_hosts:
- "host.docker.internal:host-gateway"
working_dir: /app
depends_on:
mysql:
condition: service_healthy
networks:
- laravel
mysql:
image: mysql:8.4
container_name: laravel_mysql
restart: unless-stopped
environment:
MYSQL_DATABASE: ${DB_DATABASE:-laravel}
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD:-1234}
MYSQL_USER: ${DB_USERNAME:-laravel}
MYSQL_PASSWORD: ${DB_PASSWORD:-1234}
ports:
- "3399:${DB_PORT:-3306}"
volumes:
- ./docker/database:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${DB_PASSWORD:-1234}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- laravel
node:
build:
context: ./docker/node
dockerfile: Dockerfile
container_name: laravel_node
restart: unless-stopped
volumes:
- ./src:/app
working_dir: /app
# Keeps the container alive for running npm commands interactively
# Override with: docker compose run --rm node npm run dev
command: sh -c "npm install && npm run build"
networks:
- laravel
redis:
image: redis:7.4-alpine
container_name: laravel_redis
restart: unless-stopped
ports:
- "6399:6379"
networks:
- laravel
networks:
laravel:
driver: bridge