-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
182 lines (174 loc) · 5.73 KB
/
Copy pathdocker-compose.yml
File metadata and controls
182 lines (174 loc) · 5.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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
services:
# Caddy is a web server that can automatically obtain and renew SSL certificates from Let's Encrypt (https://caddyserver.com/)
# It is used as a reverse proxy to handle HTTPS traffic and redirect HTTP to HTTPS
# If you need this functionality, then uncomment the following lines and adjust the Caddyfile accordingly
# (Create a Caddyfile in the same directory as this docker-compose.yml file, or download it from Yaffa's GitHub repository)
# You also need to adjust the port settings of the app container to listen to the port that Caddy is forwarding to. Also, enable the Caddy dependency in the app container.
# caddy:
# image: caddy:latest
# container_name: yaffa_caddy
# restart: unless-stopped
# ports:
# - "80:80" # HTTP traffic
# - "443:443" # HTTPS traffic
# # - "8400:8400" # Custom port to access Yaffa. Adjust the Caddyfile accordingly
# volumes:
# - ./Caddyfile:/etc/caddy/Caddyfile # Caddyfile configuration
# - caddy_data:/data # SSL certificates & ACME storage
# - caddy_config:/config # Caddy configurations
# networks:
# - yaffa-network
# This is the main Yaffa app container
app:
image: kantorge/yaffa:latest
container_name: yaffa_app
ports:
# Select one of the following options to expose Yaffa to the world
- '80:80' # Expose YAFFA on port 80 directly, if you don't use Caddy
#- "80" # Expose the app on port 80, Caddy will handle opening it to the world
env_file:
- .env
environment:
RUNS_SCHEDULER: FALSE
# Stream Laravel application logs to the container's stderr so they show up
# in `docker logs`. Overrides LOG_STACK from .env. Remove this line if you
# prefer file-based logging into the yaffa_storage volume.
LOG_STACK: stderr
volumes:
- yaffa_storage:/var/www/html/storage # Yaffa storage for logs and planned future upload features
depends_on:
# Uncomment the following line if you use Caddy as a reverse proxy
# caddy:
# condition: service_started
# Uncomment the following lines if you use Tesseract OCR from the Docker sidecar
# tesseract:
# condition: service_healthy
db:
condition: service_healthy
redis:
condition: service_started
restart: unless-stopped
networks:
- yaffa-network
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost']
interval: 30s
timeout: 10s
retries: 3
# This container runs the Laravel scheduler to handle scheduled tasks
scheduler:
image: kantorge/yaffa:latest
container_name: yaffa_scheduler
entrypoint: ['/usr/bin/supervisord', '-c', '/etc/supervisord.conf']
env_file:
- .env
environment:
RUNS_SCHEDULER: TRUE
# See note in the `app` service above.
LOG_STACK: stderr
volumes:
- yaffa_storage:/var/www/html/storage
depends_on:
# Keep startup serialized for first-run named-volume initialization on
# shared storage to avoid sporadic Docker mkdir/file-exists races.
app:
condition: service_healthy
db:
condition: service_healthy
redis:
condition: service_started
restart: unless-stopped
networks:
- yaffa-network
# This container runs the Laravel queue worker to handle background jobs
redis:
image: redis:alpine
container_name: yaffa_redis
restart: unless-stopped
networks:
- yaffa-network
# MySQL database container to store Yaffa data
db:
image: mysql:8.0
ports:
- '${FORWARD_DB_PORT:-3306}:3306'
environment:
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
MYSQL_ROOT_HOST: '%'
MYSQL_DATABASE: '${DB_DATABASE}'
MYSQL_USER: '${DB_USERNAME}'
MYSQL_PASSWORD: '${DB_PASSWORD}'
volumes:
- yaffa_db:/var/lib/mysql
restart: unless-stopped
stop_grace_period: 1m
networks:
- yaffa-network
healthcheck:
test:
[
'CMD',
'mysqladmin',
'ping',
'-h',
'localhost',
'-u',
'root',
'-p${DB_PASSWORD}',
]
interval: 30s
start_period: 30s
timeout: 10s
retries: 3
# MailHog is an email testing tool for developers (https://github.com/mailhog/MailHog)
# Uncomment the following lines to enable MailHog, which can be used to test email sending, if you need this feature, but you don't have other email sending services set up.
# mailhog:
# image: mailhog/mailhog
# ports:
# - "1025:1025" # SMTP server
# - "8025:8025" # Web UI
# container_name: mailhog
# networks:
# - yaffa-network
# Tesseract OCR HTTP service
# Uncomment the following lines if you use Tesseract OCR from the Docker sidecar
# tesseract:
# image: franky1/tesseract-ocr:5.5.2
# container_name: yaffa_tesseract
# ports:
# - '8888:8888'
# environment:
# # Comma-separated list of languages to install (eng, fra, deu, etc.)
# TESSERACT_LANGUAGES: 'eng'
# # HTTP server timeout in seconds
# TESSERACT_TIMEOUT: 30
# PORT: 8888
# volumes:
# # Temporary directory for processing
# - '/tmp:/tmp'
# networks:
# - yaffa-network
# healthcheck:
# test: ['CMD', 'curl', '-f', 'http://localhost:8888/health']
# interval: 10s
# timeout: 5s
# retries: 3
# start_period: 5s
# restart: unless-stopped
# # Optional: Resource limits for Docker
# deploy:
# resources:
# limits:
# cpus: '2'
# memory: 1G
# reservations:
# cpus: '1'
# memory: 512M
volumes:
caddy_data:
caddy_config:
yaffa_db:
yaffa_storage:
networks:
yaffa-network:
driver: bridge