This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathdocker-compose.yml
81 lines (73 loc) · 2.05 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
# Docker-compose file is used only for local development. This is not production-ready example.
version: '3.8'
volumes:
pg-data: {}
redis-data: {}
tmp-data: {}
services:
app: &app
build:
context: .
dockerfile: Dockerfile
user: "${APP_UID:-10001}:${APP_GID:-10001}"
environment:
PS1: '\[\033[1;32m\]\[\033[1;36m\][\u@\h] \[\033[1;34m\]\w\[\033[0;35m\] \[\033[1;36m\]# \[\033[0m\]'
HOME: /tmp
APP_DEBUG: 'true'
APP_ENV: local
REDIS_HOST: redis
REDIS_PASSWORD: redis_password
DB_HOST: postgres
DB_DATABASE: forge
DB_USERNAME: forge
DB_PASSWORD: forge
volumes:
- /etc/passwd:/etc/passwd:ro
- /etc/group:/etc/group:ro
- tmp-data:/tmp:rw
- .:/app:rw
depends_on:
postgres: {condition: service_healthy}
redis: {condition: service_healthy}
web:
<<: *app
command: rr serve -c .rr.local.yaml
ports:
- '8080:8080/tcp'
- '8443:8443/tcp'
healthcheck:
test: ['CMD', 'wget', '--spider', '-q', 'http://127.0.0.1:8082/health?plugin=http&plugin=rpc']
interval: 2s
timeout: 2s
queue:
<<: *app
command: php /app/artisan queue:work --memory=256 --sleep=1
cron:
<<: *app
command: supercronic /etc/supercronic/laravel # it runs artisan schedule:run
postgres:
image: public.ecr.aws/docker/library/postgres:15-alpine
environment:
POSTGRES_DB: forge
POSTGRES_USER: forge
POSTGRES_PASSWORD: forge
volumes:
- pg-data:/var/lib/postgresql/data:rw
ports:
- '5432/tcp'
healthcheck: # Healthcheck docs: <https://docs.docker.com/engine/reference/builder/#healthcheck>
test: ['CMD', 'pg_isready', '-U', 'forge']
interval: 2s
timeout: 5s
start_period: 2s
redis:
image: public.ecr.aws/docker/library/redis:7-alpine
command: redis-server --requirepass redis_password
volumes:
- redis-data:/data:rw
ports:
- '6379/tcp'
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 500ms
timeout: 1s