-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
71 lines (68 loc) · 1.98 KB
/
docker-compose.yml
File metadata and controls
71 lines (68 loc) · 1.98 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
services:
# Redis for caching
redis:
image: redis:alpine
container_name: application-redis
ports:
- "${REDIS_PORT_HOST:-7400}:6379"
networks:
- network
restart: unless-stopped
volumes:
- ./database/redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
# Simple Redis configuration
command: redis-server --appendonly yes
# Application
application:
build:
context: .
dockerfile: Dockerfile
# Use build args for cross-platform builds
args:
- BUILDKIT_INLINE_CACHE=1
image: application:latest
container_name: application
# Removed platform specification for cross-platform compatibility
environment:
DATABASE_URL: file:/app/data/data.db
REDIS_URL: redis://redis:6379
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
NODE_ENV: production
BUN_INSTALL_CACHE_DIR: /tmp/bun-cache
depends_on:
redis:
condition: service_healthy
networks:
- network
restart: unless-stopped
# Cross-platform volume mounts
volumes:
- ./logs:/app/logs:rw
- database_data:/app/data:rw
- ./.env:/app/.env:ro
# Security and performance optimizations
security_opt:
- no-new-privileges:true
read_only: false
tmpfs:
- /tmp:noexec,nosuid,size=500m
healthcheck:
test: ["CMD", "bun", "--print", "process.exit(0)"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
volumes:
redis_data:
driver: local
database_data:
driver: local
networks:
network:
driver: bridge