-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
90 lines (86 loc) · 2.37 KB
/
docker-compose.yml
File metadata and controls
90 lines (86 loc) · 2.37 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
services:
db:
image: postgres:16-alpine
container_name: forfarm_db
restart: unless-stopped
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-@Password123}
POSTGRES_DB: ${POSTGRES_DB:-postgres}
ports:
- "5433:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER:-postgres} -d $${POSTGRES_DB:-postgres}"]
interval: 10s
timeout: 5s
retries: 5
rabbitmq:
image: rabbitmq:3-management-alpine
container_name: forfarm_rabbitmq
restart: unless-stopped
volumes:
- rabbitmq_data:/var/lib/rabbitmq/
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER:-user}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD:-password}
ports:
- "5672:5672"
- "15672:15672"
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 10s
timeout: 5s
retries: 5
backend:
container_name: forfarm_backend
build:
context: ./backend
dockerfile: go.dockerfile
restart: unless-stopped
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
rabbitmq:
condition: service_healthy
env_file:
- ./backend/.env
# If running migrations inside the container:
# command: sh -c "/app/api migrate && /app/api api"
# If running migrations separately (preferred):
command: ["api"] # Runs the default command in the Dockerfile
volumes: # Optional: Mount source for live reload during dev (remove for prod builds)
- ./backend:/app
# networks:
# - forfarm-net
frontend:
container_name: forfarm_frontend
build:
context: ./frontend
dockerfile: next.dockerfile
# args:
# NEXT_PUBLIC_BACKEND_URL: ${NEXT_PUBLIC_BACKEND_URL}
restart: unless-stopped
ports:
- "3000:3000"
depends_on:
- backend
env_file:
- ./frontend/.env
# volumes: # Mount source for live reload during dev (remove for prod builds)
# - ./frontend:/app
# - /app/node_modules # Avoid overwriting node_modules
# - /app/.next # Avoid overwriting build artifacts
# networks:
# - forfarm-net
volumes:
postgres_data:
driver: local
rabbitmq_data:
driver: local
# networks:
# forfarm-net:
# driver: bridge