forked from pixelfed/pixelfed
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.simple.yml
118 lines (112 loc) · 3.12 KB
/
docker-compose.simple.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
---
# version: '3'
# This is a bare minimum docker compose for you to use if the
# env variable heavy one doesn't suit you.
# In order to set configuration, please use a .env.docker
# file in your compose project directory (the same directory
# as your docker-compose.yml), and set database options,
# application name, key, and other settings there.
# Please note that this docker compose ignore all `DOCKER_`
# variables.
# A list of available settings is available in .env.example
#
# The services should scale properly across a swarm cluster
# if the volumes are properly shared between cluster members.
services:
## App, Worker and Cron
web:
image: ghcr.io/pixelfed-glitch/pixelfed:latest
restart: unless-stopped
env_file:
- .env.docker
volumes:
- ./data:/var/www/storage
- ./cache:/var/www/bootstrap/cache
- "./.env.docker:/var/www/.env"
ports:
- "8080:80"
environment:
# Used by Pixelfed Docker init script
DOCKER_SERVICE_NAME: "web"
depends_on:
- db
- redis
healthcheck:
test: 'curl --fail http://localhost/api/service/health-check'
interval: 10s
timeout: 5s
retries: 2
worker:
image: ghcr.io/pixelfed-glitch/pixelfed:fpm-latest
command: gosu www-data php artisan horizon
restart: unless-stopped
env_file:
- .env.docker
volumes:
- ./data:/var/www/storage
- ./cache:/var/www/bootstrap/cache
- "./.env.docker:/var/www/.env"
environment:
# Used by Pixelfed Docker init script
DOCKER_SERVICE_NAME: "worker"
ENTRYPOINT_SKIP_SCRIPTS: ${ENTRYPOINT_SKIP_SCRIPTS:-}
depends_on:
- db
- redis
healthcheck:
test: gosu www-data php artisan horizon:status | grep running
interval: 10s
timeout: 5s
retries: 2
cron:
image: ghcr.io/pixelfed-glitch/pixelfed:fpm-latest
command: gosu www-data php artisan schedule:work -vvv
restart: unless-stopped
stop_signal: SIGTERM
env_file:
- .env.docker
volumes:
- ./data:/var/www/storage
- ./cache:/var/www/bootstrap/cache
- "./.env.docker:/var/www/.env"
environment:
# Used by Pixelfed Docker init script
DOCKER_SERVICE_NAME: "cron"
ENTRYPOINT_SKIP_SCRIPTS: ${ENTRYPOINT_SKIP_SCRIPTS:-}
depends_on:
- db
- redis
healthcheck:
test: ps aux | egrep 'php artisan [s]chedule:work -vvv'
interval: 10s
timeout: 5s
retries: 2
## DB and Cache
db:
image: mariadb:lts
command: --default-authentication-plugin=mysql_native_password
restart: unless-stopped
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect"]
interval: 10s
timeout: 5s
retries: 2
env_file:
- .env.docker
volumes:
- "./db:/var/lib/mysql"
redis:
image: redis:7.4-alpine
command: " --requirepass '${REDIS_PASSWORD:-}'"
restart: unless-stopped
environment:
- REDISCLI_AUTH=${REDIS_PASSWORD:-}
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 2
env_file:
- .env.docker
volumes:
- "./redis:/data"