-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
137 lines (127 loc) · 2.72 KB
/
docker-compose.yml
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
services:
app:
container_name: laravel-app
build:
context: laravel
dockerfile: Dockerfile
volumes:
- ./laravel/:/var/www
depends_on:
- db
- redis
- rabbitmq
command: ["php-fpm"]
networks:
- app
next:
container_name: next-app
build:
context: next
dockerfile: Dockerfile
volumes:
- ./next/:/var/app
command: sh -c "npm run build && npm run ${NEXT_RUN}"
ports:
- '3000:3000'
networks:
- app
horizon:
container_name: horizon
build:
context: laravel
dockerfile: Dockerfile
volumes:
- ./laravel/:/var/www
depends_on:
- db
- redis
- rabbitmq
command: ["php","artisan","horizon"]
profiles:
- workers
restart: always
networks:
- app
schedule:
container_name: schedule
build:
context: laravel
dockerfile: Dockerfile
volumes:
- ./laravel/:/var/www
depends_on:
- db
- redis
- rabbitmq
command: ["php", "artisan", "schedule:run"]
profiles:
- workers
restart: always
networks:
- app
# db:
# image: mysql:8.0
# restart: always
# environment:
# MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
# MYSQL_DATABASE: ${DB_DATABASE}
# MYSQL_USER: ${DB_USERNAME}
# MYSQL_PASSWORD: ${DB_PASSWORD}
# volumes:
# - ./docker/data:/var/lib/mysql
# ports:
# - ${DB_PORT}:${DB_PORT}
# networks:
# - app
db:
image: postgres:15
restart: always
volumes:
- ./docker/data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=${DB_DATABASE}
- POSTGRES_USER=${DB_USERNAME}
- POSTGRES_PASSWORD=${DB_PASSWORD}
ports:
- ${DB_PORT}:${DB_PORT}
networks:
- app
nginx:
container_name: nginx
image: nginx:stable-alpine
restart: always
ports:
- "80:80"
volumes:
- ./laravel/:/var/www
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
networks:
- app
rabbitmq:
image: rabbitmq:3-management
container_name: rabbitmq
hostname: ${RABBITMQ_HOST}
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD}
ports:
- ${RABBITMQ_ADMIN_PORT}:${RABBITMQ_ADMIN_PORT}
- ${RABBITMQ_PORT}:${RABBITMQ_PORT}
restart: always
volumes:
- ./docker/rabbitmq:/var/lib/rabbitmq
networks:
- app
redis:
image: redis:alpine
container_name: redis
restart: unless-stopped
volumes:
- ./docker/redis:/data
ports:
- ${REDIS_PORT}:${REDIS_PORT}
networks:
- app
networks:
app:
name: app