-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
74 lines (68 loc) · 1.61 KB
/
docker-compose.yml
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
services:
# Backend service (Rails)
backend:
build:
context: ./backend
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -b '0.0.0.0'"
volumes:
- ./backend:/rails
ports:
# host_port: container_port
- "3000:3000"
depends_on:
- db
- elasticsearch
- redis
environment:
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/GearMate_development
RAILS_ENV: development
REDIS_URL: redis://redis:6379/1
env_file:
- .env
redis:
image: redis:6
ports:
- "6379:6379"
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.11
environment:
- discovery.type=single-node
ports:
- "9200:9200"
volumes:
- es_data:/usr/share/elasticsearch/data
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:9200 || exit 1"]
interval: 30s
timeout: 10s
retries: 3
# Frontend service (React)
frontend:
build:
context: ./client
volumes:
- ./client:/client
- node_modules:/client/node_modules
ports:
- "5173:5173"
stdin_open: true
tty: true
depends_on:
- backend
command: npm run dev -- --host
# PostgreSQL database service
db:
image: postgres:16
volumes:
- pgdata:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: GearMate_development
ports:
- "5432:5432"
# Persistent storage for the PostgreSQL database
volumes:
pgdata:
node_modules:
es_data: