-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
102 lines (98 loc) · 3.56 KB
/
docker-compose.yml
File metadata and controls
102 lines (98 loc) · 3.56 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
services:
db:
container_name: word-generator-db
image: pgautoupgrade/pgautoupgrade:18-trixie
volumes:
- postgres_data:/var/lib/postgresql
ports:
- "127.0.0.1:${POSTGRES_PORT:-5432}:5432"
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres}
restart: unless-stopped
# Prevent 1.7GB core dumps from filling the disk if spaCy/NumPy crashes
ulimits:
core: 0
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -q"]
interval: 5s
timeout: 5s
retries: 5
start_period: 10s
api:
container_name: word-generator-api
image: ghcr.io/bolinocroustibat/word-generator-api:${TAG:-latest}
build: .
depends_on:
db:
condition: service_healthy
ports:
- "${API_PORT:-8000}:8000"
environment:
# Application settings
- ENVIRONMENT=${ENVIRONMENT:-unknown}
# CORS settings
- ALLOW_ORIGINS=${ALLOW_ORIGINS}
# Authentication settings
- API_USERNAME=${API_USERNAME}
- API_PASSWORD=${API_PASSWORD}
# Database settings
- POSTGRES_DB=${POSTGRES_DB}
# External API settings
- DICTIONNARY_FR_API_KEY=${DICTIONNARY_FR_API_KEY}
# Twitter Configuration - English
- TWITTER_EN_API_KEY=${TWITTER_EN_API_KEY}
- TWITTER_EN_KEY_SECRET=${TWITTER_EN_KEY_SECRET}
- TWITTER_EN_ACCESS_TOKEN=${TWITTER_EN_ACCESS_TOKEN}
- TWITTER_EN_TOKEN_SECRET=${TWITTER_EN_TOKEN_SECRET}
# Twitter Configuration - French
- TWITTER_FR_API_KEY=${TWITTER_FR_API_KEY}
- TWITTER_FR_KEY_SECRET=${TWITTER_FR_KEY_SECRET}
- TWITTER_FR_ACCESS_TOKEN=${TWITTER_FR_ACCESS_TOKEN}
- TWITTER_FR_TOKEN_SECRET=${TWITTER_FR_TOKEN_SECRET}
# Sentry Configuration
- SENTRY_DSN=${SENTRY_DSN}
- SENTRY_CRON_MONITOR_ID_EN=${SENTRY_CRON_MONITOR_ID_EN}
- SENTRY_CRON_MONITOR_ID_FR=${SENTRY_CRON_MONITOR_ID_FR}
restart: unless-stopped
# Prevent 1.7GB core dumps from filling the disk if spaCy/NumPy crashes
ulimits:
core: 0
healthcheck:
test: ["CMD", "uv", "run", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
cron:
container_name: word-generator-cron
image: ghcr.io/bolinocroustibat/word-generator-api:${TAG:-latest}
build: .
depends_on:
db:
condition: service_healthy
environment:
- ENVIRONMENT=${ENVIRONMENT:-unknown}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres}
- DICTIONNARY_FR_API_KEY=${DICTIONNARY_FR_API_KEY}
- TWITTER_EN_API_KEY=${TWITTER_EN_API_KEY}
- TWITTER_EN_KEY_SECRET=${TWITTER_EN_KEY_SECRET}
- TWITTER_EN_ACCESS_TOKEN=${TWITTER_EN_ACCESS_TOKEN}
- TWITTER_EN_TOKEN_SECRET=${TWITTER_EN_TOKEN_SECRET}
- TWITTER_FR_API_KEY=${TWITTER_FR_API_KEY}
- TWITTER_FR_KEY_SECRET=${TWITTER_FR_KEY_SECRET}
- TWITTER_FR_ACCESS_TOKEN=${TWITTER_FR_ACCESS_TOKEN}
- TWITTER_FR_TOKEN_SECRET=${TWITTER_FR_TOKEN_SECRET}
- SENTRY_DSN=${SENTRY_DSN}
- SENTRY_CRON_MONITOR_ID_EN=${SENTRY_CRON_MONITOR_ID_EN}
- SENTRY_CRON_MONITOR_ID_FR=${SENTRY_CRON_MONITOR_ID_FR}
command: ["/app/scripts/cron-entrypoint.sh"]
restart: unless-stopped
# Prevent 1.7GB core dumps from filling the disk if spaCy/NumPy crashes
ulimits:
core: 0
volumes:
postgres_data: