-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
51 lines (50 loc) · 1.4 KB
/
docker-compose.yml
File metadata and controls
51 lines (50 loc) · 1.4 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
services:
rabbitmq:
image: rabbitmq:4.2.0-management-alpine
container_name: rabbitmq
ports:
- "5672:5672" # AMQP protocol
- "15672:15672" # Web UI (http://localhost:15672)
environment:
RABBITMQ_DEFAULT_USER: urystem
RABBITMQ_DEFAULT_PASS: admin123
builder:
image: golang:1.24.4-alpine3.22
working_dir: /app
volumes:
- .:/app # текущая папка хоста монтируется в /app
command: >
sh -c "CGO_ENABLED=0 GOOS=linux go build -ldflags='-s -w -extldflags \"-static\"' -o pizza cmd/main.go"
db:
image: postgres:alpine3.22
container_name: rss_db
ports:
- ${POSTGRES_PORT:-5432}:5432
# volumes:
# - pgdata:/var/lib/postgresql/data
environment:
POSTGRES_USER: restaurant_user
POSTGRES_PASSWORD: restaurant_pass
POSTGRES_DB: restaurant_db
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U restaurant_user -d restaurant_db" ]
interval: 3s
timeout: 5s
retries: 10
migrate:
image: migrate/migrate
container_name: rss_migrate
volumes:
- ./migrations:/migrations
entrypoint:
[
"migrate",
"-path",
"/migrations",
"-database",
"postgres://restaurant_user:restaurant_pass@db:5432/restaurant_db?sslmode=disable",
"up"
]
depends_on:
db:
condition: service_healthy