-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
94 lines (89 loc) · 2.59 KB
/
Copy pathdocker-compose.yml
File metadata and controls
94 lines (89 loc) · 2.59 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
services:
# Compiler - for local development and CI/CD
# Usage: docker-compose run --rm compiler -p -n mynode -m /puppet/modules /puppet/manifests/site.pp
compiler:
build:
context: .
target: compiler
image: puppetc-compile:latest
volumes:
- ./puppetcode/manifests:/puppet/manifests:ro
- ./puppetcode/modules:/puppet/modules:ro
- ./puppetcode/hiera:/puppet/hiera:ro
- ./puppetcode/facts.yaml:/puppet/facts.yaml:ro
server:
build:
context: .
target: server
image: puppetc-server:latest
container_name: puppetc-server
ports:
- "8140:8140"
volumes:
- ./puppetcode/manifests:/etc/puppet/manifests:ro
- ./puppetcode/modules:/etc/puppet/modules:ro
- ./puppetcode/hiera:/etc/puppet/hiera:ro
- puppetc-server-ssl:/etc/puppetc/ssl
environment:
- PUPPET_CA_PATH=/etc/puppetc/ssl/ca/ca_crt.pem
networks:
- puppet
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:8140/status"]
interval: 10s
timeout: 5s
retries: 3
# One-shot agent - runs and exits
# Usage: docker-compose run agent (noop mode)
# docker-compose run agent -a (apply mode)
agent:
build:
context: .
target: agent
image: puppetc-agent:latest
depends_on:
server:
condition: service_healthy
volumes:
- puppetc-agent-ssl:/var/lib/puppetc/ssl
environment:
- PUPPET_SERVER=https://server:8140
- PUPPET_CA_PATH=/var/lib/puppetc/ssl/ca/ca_crt.pem
- PUPPET_SSL_DIR=/var/lib/puppetc/ssl
networks:
- puppet
# Interactive agent shell - stays running for multiple runs
# Usage: docker-compose up -d agent-shell
# docker-compose exec agent-shell bash
# # Then run: puppetc-agent -n or puppetc-agent -a
agent-shell:
build:
context: .
target: agent
image: puppetc-agent:latest
container_name: puppetc-agent-shell
depends_on:
server:
condition: service_healthy
volumes:
- puppetc-agent-shell-ssl:/var/lib/puppetc/ssl
environment:
- PUPPET_SERVER=https://server:8140
- PUPPET_CA_PATH=/var/lib/puppetc/ssl/ca/ca_crt.pem
- PUPPET_SSL_DIR=/var/lib/puppetc/ssl
networks:
- puppet
stdin_open: true
tty: true
entrypoint: ["bash"]
command: ["-c", "echo 'Agent shell ready. Run: puppetc-agent -n (noop) or puppetc-agent -a (apply)' && exec bash"]
networks:
puppet:
driver: bridge
volumes:
puppetc-server-ssl:
driver: local
puppetc-agent-ssl:
driver: local
puppetc-agent-shell-ssl:
driver: local