forked from Team-Moru/moru-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
85 lines (68 loc) · 2.57 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
85 lines (68 loc) · 2.57 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
x-awslogs: &awslogs
driver: awslogs
options:
awslogs-region: ${CLOUDWATCH_LOG_REGION:-ap-northeast-2}
awslogs-group: ${CLOUDWATCH_LOG_GROUP:-/moru/prod/app}
awslogs-create-group: "false"
tag: "{{.Name}}/{{.ID}}"
mode: "non-blocking"
max-buffer-size: "${CLOUDWATCH_LOG_BUFFER_SIZE:-4m}"
services:
app:
image: ${DOCKER_IMAGE:?DOCKER_IMAGE is required}
container_name: moru-server
env_file:
- .env
environment:
SPRING_PROFILES_ACTIVE: ${SPRING_PROFILES_ACTIVE:-prod}
SERVER_PORT: ${SERVER_PORT:-8080}
SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.cj.jdbc.Driver
SPRING_DATASOURCE_URL: ${DB_URL:?DB_URL is required}
SPRING_DATASOURCE_USERNAME: ${DB_USERNAME:?DB_USERNAME is required}
SPRING_DATASOURCE_PASSWORD: ${DB_PASSWORD:?DB_PASSWORD is required}
SPRING_JPA_HIBERNATE_DDL_AUTO: ${JPA_DDL_AUTO:-validate}
SPRING_JPA_OPEN_IN_VIEW: "false"
SPRING_JPA_PROPERTIES_HIBERNATE_FORMAT_SQL: "false"
SPRING_FLYWAY_ENABLED: ${FLYWAY_ENABLED:-true}
LOGGING_LEVEL_ORG_HIBERNATE_SQL: info
LOGGING_LEVEL_ORG_HIBERNATE_ORM_JDBC_BIND: off
JWT_SECRET: ${JWT_SECRET:?JWT_SECRET is required}
JWT_ACCESS_TOKEN_EXPIRATION: ${JWT_ACCESS_TOKEN_EXPIRATION:-1h}
JWT_REFRESH_TOKEN_EXPIRATION: ${JWT_REFRESH_TOKEN_EXPIRATION:-14d}
DEV_AUTH_SECRET: ${DEV_AUTH_SECRET:?DEV_AUTH_SECRET is required}
REDIS_URL: redis://:${REDIS_PASSWORD:?REDIS_PASSWORD is required}@redis:6379
GOOGLE_TTS_ENABLED: ${GOOGLE_TTS_ENABLED:-false}
GOOGLE_TTS_CREDENTIALS_PATH: file:/run/secrets/gcp-key.json
volumes:
- ./secrets/gcp-key.json:/run/secrets/gcp-key.json:ro
ports:
- "127.0.0.1:${SERVER_PORT:-8080}:${SERVER_PORT:-8080}"
depends_on:
redis:
condition: service_healthy
restart: unless-stopped
stop_grace_period: 90s
logging: *awslogs
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:${SERVER_PORT:-8080}/health || exit 1"]
interval: 30s
timeout: 5s
retries: 3
start_period: 40s
redis:
image: redis:7.4-alpine
container_name: moru-redis
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD:?REDIS_PASSWORD is required}
command: ["sh", "-c", "redis-server --appendonly yes --requirepass \"$$REDIS_PASSWORD\""]
volumes:
- moru-redis-data:/data
restart: unless-stopped
logging: *awslogs
healthcheck:
test: ["CMD-SHELL", "redis-cli -a \"$$REDIS_PASSWORD\" ping | grep PONG"]
interval: 10s
timeout: 3s
retries: 5
volumes:
moru-redis-data: