-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
54 lines (53 loc) · 1.42 KB
/
docker-compose.yml
File metadata and controls
54 lines (53 loc) · 1.42 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
services:
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 rss cmd/main.go"
rss:
build:
dockerfile: Dockerfile
environment:
POSTGRES_HOST: db
env_file:
- .env
entrypoint: ["/app/rss", "fetch"]
depends_on:
- migrate
db:
image: postgres:alpine3.22
container_name: rss_db
ports:
- ${POSTGRES_PORT:-5432}:5432
# volumes:
# - pgdata:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${POSTGRES_USER:-ukabdoll}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-07654321}
POSTGRES_DB: ${POSTGRES_DBNAME:-rss}
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-ukabdoll} -d ${POSTGRES_DBNAME:-rss}" ]
interval: 3s
timeout: 5s
retries: 10
migrate:
image: migrate/migrate
container_name: rss_migrate
volumes:
- ./internal/adapters/driven/storage/migrations:/migrations
entrypoint:
[
"migrate",
"-path",
"/migrations",
"-database",
"postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DBNAME}?sslmode=disable",
"up"
]
depends_on:
db:
condition: service_healthy
# volumes:
# pgdata: