-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
80 lines (78 loc) · 1.97 KB
/
docker-compose.yml
File metadata and controls
80 lines (78 loc) · 1.97 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
services:
db:
image: postgres:17.2-alpine
restart: always
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 5s
retries: 5
environment:
- POSTGRES_USER=${DB_USER:-postgres}
- POSTGRES_PASSWORD=${DB_PASSWORD:-postgres}
- POSTGRES_DB=${DB_NAME:-postgres}
ports:
- '${DB_PORT:-5432}:5432'
volumes:
- db:/var/lib/postgresql/data
- ./db/data.csv:/docker-entrypoint-initdb.d/data.csv
- ./db/init.sql:/docker-entrypoint-initdb.d/create_tables.sql
cache:
image: redis:7.2-alpine
restart: always
ports:
- '${REDIS_PORT:-6379}:6379'
command: redis-server --save 20 1 --loglevel notice --requirepass ${REDIS_PASSWORD:-123456}
volumes:
- cache:/data
api:
container_name: vibecheck
build:
context: ./
image: vibecheck
restart: always
depends_on:
db:
condition: service_healthy
cache:
condition: service_started
ports:
- '${API_PORT:-8080}:${API_INTERNAL_PORT:-9000}'
environment:
DB_HOST: ${DB_HOST:-db}
DB_PORT: ${DB_PORT:-5432}
DB_USER: ${DB_USER:-postgres}
DB_PASSWORD: ${DB_PASSWORD:-postgres}
DB_NAME: ${DB_NAME:-postgres}
REDIS_HOST: ${REDIS_HOST:-cache}
REDIS_PORT: ${REDIS_PORT:-6379}
REDIS_PASSWORD: ${REDIS_PASSWORD:-123456}
REDIS_DB: ${REDIS_DB:-0}
LIST_PER_PAGE: ${LIST_PER_PAGE:-10}
API_INTERNAL_PORT: ${API_INTERNAL_PORT:-9000}
links:
- db
- cache
frontend:
container_name: vibecheck-frontend
build:
context: ./frontend
image: vibecheck-frontend
restart: always
ports:
- '${FRONTEND_PORT:-3000}:3000'
environment:
API_HOST: ${API_HOST:-localhost}
API_PORT: ${API_PORT:-8080}
links:
- api
depends_on:
api:
condition: service_started
volumes:
- ./frontend:/src
volumes:
db:
driver: local
cache:
driver: local