-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
100 lines (93 loc) · 2.19 KB
/
docker-compose.yml
File metadata and controls
100 lines (93 loc) · 2.19 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
91
92
93
94
95
96
97
98
99
100
version: '3.8'
services:
markgo:
build:
context: .
dockerfile: Dockerfile
container_name: markgo-app
ports:
- "8080:8080"
environment:
- ENVIRONMENT=production
- PORT=8080
- BLOG_TITLE=MarkGo Blog
- BLOG_DESCRIPTION=High-performance file-based blog engine
- BLOG_AUTHOR=MarkGo Team
- BASE_URL=http://localhost:8080
- CACHE_ENABLED=true
- CACHE_TTL=3600
- SEARCH_ENABLED=true
- RSS_ENABLED=true
- CONTACT_ENABLED=true
volumes:
- ./articles:/articles:ro
- ./web:/web:ro
- ./uploads:/uploads
- logs:/var/log/markgo
restart: unless-stopped
healthcheck:
test: ["CMD", "/markgo", "--health-check"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- markgo-network
# Optional: Redis for enhanced caching (if needed in future)
# redis:
# image: redis:7-alpine
# container_name: markgo-redis
# command: redis-server --appendonly yes
# volumes:
# - redis-data:/data
# networks:
# - markgo-network
# restart: unless-stopped
# Optional: Nginx reverse proxy for production
nginx:
image: nginx:alpine
container_name: markgo-nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./deployments/nginx.conf:/etc/nginx/nginx.conf:ro
- ./deployments/ssl:/etc/nginx/ssl:ro
- logs:/var/log/nginx
depends_on:
- markgo
networks:
- markgo-network
restart: unless-stopped
profiles:
- production
volumes:
logs:
driver: local
# redis-data:
# driver: local
networks:
markgo-network:
driver: bridge
# Development override
---
# docker-compose.override.yml (for development)
version: '3.8'
services:
markgo:
build:
target: builder # Use multi-stage build target for development
environment:
- ENVIRONMENT=development
- GIN_MODE=debug
volumes:
- ./articles:/articles
- ./web:/web
- ./internal:/app/internal
- ./cmd:/app/cmd
command: go run cmd/markgo/main.go serve
ports:
- "8080:8080"
- "2345:2345" # Delve debugger port
stdin_open: true
tty: true