-
Notifications
You must be signed in to change notification settings - Fork 180
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
59 lines (57 loc) · 1.35 KB
/
docker-compose.yml
File metadata and controls
59 lines (57 loc) · 1.35 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
# ============================================
# Docker Compose Configuration
# ============================================
# Usage:
# Development: docker compose up dev
# Production: docker compose up prod
# Build only: docker compose build
# ============================================
services:
# Production service with nginx
prod:
build:
context: .
dockerfile: Dockerfile
target: production
container_name: axios-docs-prod
ports:
- "8080:8080"
restart: unless-stopped
read_only: true
tmpfs:
- /var/cache/nginx
- /var/run
security_opt:
- no-new-privileges:true
healthcheck:
test:
[
"CMD",
"wget",
"--no-verbose",
"--tries=1",
"--spider",
"http://localhost:8080/",
]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
# Development service with hot reload capability
dev:
build:
context: .
dockerfile: Dockerfile
target: development
container_name: axios-docs-dev
ports:
- "8080:8080"
volumes:
# Mount source files for development
- .:/app
# Prevent overwriting container's node_modules
- /app/node_modules
environment:
- NODE_ENV=development
command: >
sh -c "npm run build && npm run server"