-
-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathdocker-compose.dev.sqlite.yml
More file actions
131 lines (122 loc) · 3.12 KB
/
docker-compose.dev.sqlite.yml
File metadata and controls
131 lines (122 loc) · 3.12 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
# Journiv Development Docker Compose (SQLite)
# Recommended for quick local development.
#
# Usage:
# docker compose -f docker-compose.dev.sqlite.yml up -d
# Note: dev compose files uses the main tag (docker image from main # branch) for development purposes. Do not run this for production # use prod compose files instead which uses the latest tag.
x-common-valkey-env: &common-valkey-env
REDIS_URL: redis://valkey:6379/0
CELERY_BROKER_URL: redis://valkey:6379/0
CELERY_RESULT_BACKEND: redis://valkey:6379/0
x-dev-common: &dev-common
build: .
env_file:
- .env
volumes:
- .:/app
- ./data:/data
depends_on:
valkey:
condition: service_healthy
environment:
DB_DRIVER: sqlite
DATABASE_URL: sqlite:////data/journiv.db
ENVIRONMENT: development
x-celery-healthcheck: &celery-healthcheck
interval: 30s
timeout: 10s
retries: 5
start_period: 40s
services:
# Journiv uses Valkey which is similar to Redis for cache.
valkey:
image: valkey/valkey:9.0-alpine
container_name: journiv-dev-valkey
restart: unless-stopped
volumes:
- ./data/valkey:/data
healthcheck:
test: ["CMD", "valkey-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
celery-worker:
<<: *dev-common
container_name: journiv-dev-celery-worker
command: celery -A app.core.celery_app worker --loglevel=info
environment:
<<: *common-valkey-env
SERVICE_ROLE: celery-worker
restart: unless-stopped
healthcheck:
<<: *celery-healthcheck
deploy:
resources:
limits:
memory: 512m
reservations:
memory: 256m
celery-beat:
<<: *dev-common
container_name: journiv-dev-celery-beat
command: celery -A app.core.celery_app beat --loglevel=info --scheduler redbeat.RedBeatScheduler --pidfile=/tmp/celerybeat.pid
environment:
<<: *common-valkey-env
SERVICE_ROLE: celery-beat
REDBEAT_REDIS_URL: redis://valkey:6379/2
restart: unless-stopped
deploy:
resources:
limits:
cpus: "1.0"
memory: 1g
reservations:
memory: 256m
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "5"
healthcheck:
<<: *celery-healthcheck
app:
<<: *dev-common
container_name: journiv-dev-sqlite-app
ports:
- "${APP_PORT:-8000}:8000"
environment:
<<: *common-valkey-env
SERVICE_ROLE: app
deploy:
resources:
limits:
memory: 512m
reservations:
memory: 256m
healthcheck:
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
admin-cli:
<<: *dev-common
container_name: journiv-dev-sqlite-admin-cli
profiles: ["admin"]
command: ["sleep", "infinity"]
environment:
<<: *common-valkey-env
SERVICE_ROLE: admin-cli
# No healthcheck needed for idle container
healthcheck:
disable: true
deploy:
resources:
limits:
cpus: "1.0"
memory: 1g
reservations:
memory: 256m
networks:
default:
driver: bridge