-
-
Notifications
You must be signed in to change notification settings - Fork 363
Expand file tree
/
Copy pathdocker-compose.minimal.yaml
More file actions
131 lines (122 loc) · 3.49 KB
/
docker-compose.minimal.yaml
File metadata and controls
131 lines (122 loc) · 3.49 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
# Docker Compose configuration for Lychee application with FrankenPHP backend
# Version: 2026-01-10
x-base-lychee-setup: &base-lychee-setup
image: ghcr.io/lycheeorg/lychee:latest
restart: unless-stopped # Auto-restart at container level (outer layer)
# Security hardening
security_opt:
- no-new-privileges:true
- seccomp:unconfined # FrankenPHP may need this; consider custom seccomp profile
cap_drop:
- ALL
cap_add:
- CHOWN
- SETGID
- SETUID
- DAC_OVERRIDE
- NET_BIND_SERVICE
read_only: false # Laravel needs write access to storage/cache
tmpfs:
- /tmp:noexec,nosuid,nodev,size=100m
volumes:
- ./lychee/uploads:/app/public/uploads
- ./lychee/logs:/app/storage/logs
- ./lychee/tmp:/app/storage/tmp
networks:
- lychee
x-common-env: &common-env
PUID: "${PUID:-1000}"
PGID: "${PGID:-1000}"
# REPLACE ME WITH YOUR VALUE GENERATED WITH `openssl rand -base64 32`
APP_KEY: "base64:ucMiFCbfQZUFOxrQz1x9C0OBJeLCCCAieZmnEHXmyGI="
APP_NAME: "${APP_NAME:-Lychee}"
APP_ENV: "${APP_ENV:-production}"
APP_TIMEZONE: "${TIMEZONE:-UTC}"
APP_URL: "${APP_URL:-http://localhost:8000}"
APP_FORCE_HTTPS: "${APP_FORCE_HTTPS:-false}"
DB_CONNECTION: "${DB_CONNECTION:-mysql}"
DB_HOST: "${DB_HOST:-lychee_db}"
DB_PORT: "${DB_PORT:-3306}"
DB_DATABASE: "${DB_DATABASE:-lychee}"
DB_USERNAME: "${DB_USERNAME:-lychee}"
DB_PASSWORD: "${DB_PASSWORD:-password}"
SESSION_DRIVER: "${SESSION_DRIVER:-file}"
SESSION_LIFETIME: "${SESSION_LIFETIME:-120}"
QUEUE_CONNECTION: "${QUEUE_CONNECTION:-database}"
services:
lychee_api:
<<: *base-lychee-setup
container_name: lychee-api
expose:
- "${APP_PORT:-8000}"
ports:
- "${APP_PORT:-8000}:8000"
environment:
<<: *common-env
# Enable WORKER MODE
depends_on:
lychee_db:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/up"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
lychee_worker:
<<: *base-lychee-setup
container_name: lychee-worker
environment:
<<: *common-env
# Enable WORKER MODE
LYCHEE_MODE: worker
depends_on:
lychee_db:
condition: service_healthy
lychee_api:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "pgrep -f 'queue:work' || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s # Give worker time to start up
lychee_db:
image: mariadb:10
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
cap_add:
- SETGID
- SETUID
- DAC_OVERRIDE
- CHOWN
read_only: false # MariaDB needs write access
tmpfs:
- /tmp:noexec,nosuid,nodev,size=200m
- /var/run/mysqld:noexec,nosuid,nodev,size=10m
environment:
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD:-rootpassword}
- MYSQL_DATABASE=${DB_DATABASE:-lychee}
- MYSQL_USER=${DB_USERNAME:-lychee}
- MYSQL_PASSWORD=${DB_PASSWORD:-password}
expose:
- 3306
volumes:
- mysql:/var/lib/mysql
networks:
- lychee
restart: unless-stopped
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 5s
timeout: 3s
retries: 10
start_period: 10s
networks:
lychee:
volumes:
mysql:
name: lychee_prod_mysql
driver: local