Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
57 lines (54 loc) · 1.5 KB
/
Copy pathdocker-compose.yml
File metadata and controls
57 lines (54 loc) · 1.5 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
name: dailycode
services:
bot:
container_name: bot
build: .
restart: unless-stopped
stop_grace_period: 30s
depends_on:
postgres:
condition: service_healthy
restart: true
environment:
SPRING_PROFILES_ACTIVE: discord
SPRING_MAIN_WEB_APPLICATION_TYPE: none
SPRING_JPA_SHOW_SQL: "false"
LOGGING_LEVEL_ORG_HIBERNATE_SQL: INFO
DEBUG: "false"
DB_HOST: postgres
DB_PORT: "5432"
DB_NAME: ${DB_NAME:-dailycode}
DB_USER: ${DB_USER:-dailycode}
DB_PASSWORD: ${DB_PASSWORD:?Set in .env}
DISCORD_TOKEN: ${DISCORD_TOKEN:?Set in .env}
DISCORD_TEST_GUILD_ID: ${DISCORD_TEST_GUILD_ID:-}
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
postgres:
container_name: dailyCode_postgres
image: postgres:17-bookworm
restart: unless-stopped
environment:
POSTGRES_DB: ${DB_NAME:-dailycode}
POSTGRES_USER: ${DB_USER:-dailycode}
POSTGRES_PASSWORD: ${DB_PASSWORD:?Set in .env}
ports:
- "127.0.0.1:${DB_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -h 127.0.0.1 -U \"$$POSTGRES_USER\" -d \"$$POSTGRES_DB\""] # ($$ lets the container expand the variables..)
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
volumes:
postgres_data: