-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker_compose.yml
More file actions
60 lines (56 loc) · 1.58 KB
/
docker_compose.yml
File metadata and controls
60 lines (56 loc) · 1.58 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
services:
redis:
image: redis:8.2-rc1-alpine
container_name: foundation-redis
# If you want a password, set REDIS_PASSWORD in .env; otherwise leave it empty
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
command: >
sh -c '
if [ -n "$REDIS_PASSWORD" ]; then
exec redis-server --appendonly yes --requirepass "$REDIS_PASSWORD";
else
exec redis-server --appendonly yes;
fi
'
ports:
- "${REDIS_PORT:-6379}:6379"
volumes:
- redis_data:/data
healthcheck:
test: [ "CMD-SHELL", "redis-cli -a \"$REDIS_PASSWORD\" ping | grep PONG || redis-cli ping | grep PONG" ]
interval: 5s
timeout: 5s
retries: 15
networks:
- foundation_network
app:
build:
context: .
dockerfile: Dockerfile
container_name: foundation-app
env_file:
- .env
environment:
# Compose expands these at runtime using values from .env
NODE_ENV: production
REDIS_URL: 'redis://redis:6379'
REDIRECT_URL_OPEN: ${REDIRECT_URL_OPEN}
REDIRECT_URL_SECURE: ${REDIRECT_URL_SECURE}
WEEK_STARTS_ON_SUNDAY: ${WEEK_STARTS_ON_SUNDAY}
depends_on:
redis:
condition: service_healthy
ports:
# Host:Container
- "${PORT:-3131}:3131"
restart: unless-stopped
networks:
- foundation_network
# If you have migrations, uncomment the next lines and ensure the scripts exist in package.json:
# command: sh -c "bun run db:migrate && bun run start"
volumes:
redis_data:
networks:
foundation_network:
driver: bridge