-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
86 lines (81 loc) · 2.2 KB
/
docker-compose.yml
File metadata and controls
86 lines (81 loc) · 2.2 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
version: '3.8'
networks:
openfront_network:
driver: bridge
services:
# Database - keeping your existing setup
postgres:
image: postgres:15
container_name: openfront-postgres
restart: unless-stopped
networks:
- openfront_network
env_file:
- .env
volumes:
- ./sql/schema.sql:/docker-entrypoint-initdb.d/schema.sql
- postgres-data:/var/lib/postgresql/data
ports:
- "5433:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-scraper}"]
interval: 1s
timeout: 1s
retries: 30
# Your private app from Docker Hub
app:
image: floriankilian/openfront-scraper:latest
container_name: openfront-app
entrypoint: []
command: ["node", "api/index.js"]
restart: unless-stopped
networks:
- openfront_network
env_file:
- .env
ports:
- "3000:3000"
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000/health"]
interval: 15s
timeout: 5s
retries: 3
start_period: 60s
stop_grace_period: 30s
# Webhook receiver for zero-downtime deployments
webhook-receiver:
image: node:20-alpine
container_name: openfront-webhook
restart: unless-stopped
networks:
- openfront_network
ports:
- "9000:9000"
environment:
- WEBHOOK_SECRET=${WEBHOOK_SECRET}
- CONTAINER_NAME=openfront-app
- IMAGE_NAME=floriankilian/openfront-scraper
- DOCKER_USERNAME=${DOCKER_USERNAME}
- DOCKER_PASSWORD=${DOCKER_PASSWORD}
volumes:
- /var/run/docker.sock:/var/run/docker.sock:rw # FIXED: Docker socket with read-write
- ./webhook:/app
working_dir: /app
# FIXED: Install Docker CLI in the container
command: >
sh -c "
apk add --no-cache docker-cli wget curl &&
node webhook-server.js
"
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:9000/health"]
interval: 30s
timeout: 5s
retries: 3
# FIXED: Add user to docker group
user: "0:0" # Run as root to access docker socket
volumes:
postgres-data: