-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdocker-compose.softhsm.yml
More file actions
105 lines (100 loc) · 3.04 KB
/
Copy pathdocker-compose.softhsm.yml
File metadata and controls
105 lines (100 loc) · 3.04 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
101
102
103
104
105
services:
trustpoint:
build:
context: .
dockerfile: docker/trustpoint/Dockerfile
image: trustpointproject/trustpoint:latest
container_name: trustpoint
restart: unless-stopped
ports:
- "${TP_HTTP_PORT:-80}:80"
- "${TP_HTTPS_PORT:-443}:443"
depends_on:
softhsm:
condition: service_healthy
volumes:
- ./trustpoint/settings:/var/www/html/trustpoint/trustpoint/settings
- softhsm_config:/var/lib/trustpoint/hsm/config
- softhsm_tokens:/var/lib/trustpoint/hsm/tokens
environment:
POSTGRES_DB: "${POSTGRES_DB:-trustpoint_db}"
DATABASE_USER_FILE: /run/secrets/db_user
DATABASE_PASSWORD_FILE: /run/secrets/db_password
DATABASE_HOST: "${DATABASE_HOST:-postgres}"
DATABASE_PORT: "${DATABASE_PORT:-5432}"
HSM_PIN_FILE: /run/secrets/hsm_pin
HSM_SO_PIN_FILE: /run/secrets/hsm_so_pin
TRUSTPOINT_HSM_ROOT: /var/lib/trustpoint/hsm
SOFTHSM2_CONF: /var/lib/trustpoint/hsm/config/softhsm2.conf
TRUSTPOINT_LOCAL_HSM_ENABLED: "1"
TRUSTPOINT_LOCAL_HSM_TOKEN_LABEL: Trustpoint-SoftHSM
TRUSTPOINT_LOCAL_HSM_PROFILE_NAME: local-dev-softhsm
TRUSTPOINT_LOCAL_HSM_MODULE_PATH: /usr/lib/libsofthsm2.so
TRUSTPOINT_LOCAL_HSM_USER_PIN_FILE: /var/lib/trustpoint/hsm/config/user-pin.txt
TRUSTPOINT_LOCAL_HSM_CONFIG_ENV_VAR: SOFTHSM2_CONF
TRUSTPOINT_LOCAL_HSM_SOFTHSM2_CONF: /var/lib/trustpoint/hsm/config/softhsm2.conf
secrets:
- db_user
- db_password
- hsm_pin
- hsm_so_pin
healthcheck:
test: ["CMD-SHELL", "curl -fsk --max-time 5 https://localhost/ > /dev/null"]
interval: 30s
timeout: 10s
retries: 3
start_period: 90s
postgres:
build:
context: .
dockerfile: docker/db/Dockerfile
image: trustpointproject/postgres:latest
container_name: postgres
restart: unless-stopped
ports:
# Bind to loopback only – PostgreSQL must not be reachable from the network.
- "127.0.0.1:5432:5432"
volumes:
- postgres_data:/var/lib/postgresql
environment:
POSTGRES_USER_FILE: /run/secrets/db_user
POSTGRES_PASSWORD_FILE: /run/secrets/db_password
POSTGRES_DB: "${POSTGRES_DB:-trustpoint_db}"
secrets:
- db_user
- db_password
healthcheck:
test: ["CMD-SHELL", "pg_isready -h 127.0.0.1 -p 5432"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
softhsm:
build:
context: .
dockerfile: docker/softhsm/Dockerfile
container_name: softhsm
restart: unless-stopped
ports:
- "5657:5657"
volumes:
- softhsm_config:/var/lib/trustpoint/hsm/config
- softhsm_tokens:/var/lib/trustpoint/hsm/tokens
healthcheck:
test: ["CMD", "nc", "-z", "localhost", "5657"]
interval: 10s
timeout: 5s
retries: 5
secrets:
db_user:
file: db_user.txt
db_password:
file: db_password.txt
hsm_pin:
file: hsm_pin.txt
hsm_so_pin:
file: hsm_so_pin.txt
volumes:
postgres_data:
softhsm_config:
softhsm_tokens: