@@ -168,6 +168,99 @@ ALLOW_SELF_SIGNED=false \
168168yarn start
169169```
170170
171+ ## Container Deployment with Podman
172+
173+ First, build the container image:
174+
175+ ``` bash
176+ yarn container:build
177+ ```
178+
179+ For local development, you'll need to run both the Enclaved Express and Master Express containers:
180+
181+ ``` bash
182+ # Start Enclaved Express container
183+ podman run -d \
184+ -p 3080:3080 \
185+ -v $( pwd) /certs:/app/certs:Z \
186+ -e APP_MODE=enclaved \
187+ -e BIND=0.0.0.0 \
188+ -e TLS_MODE=mtls \
189+ -e TLS_KEY_PATH=/app/certs/enclaved-express-key.pem \
190+ -e TLS_CERT_PATH=/app/certs/enclaved-express-cert.pem \
191+ -e KMS_URL=host.containers.internal:3000 \
192+ -e NODE_ENV=development \
193+ -e ALLOW_SELF_SIGNED=true \
194+ bitgo-onprem-express
195+
196+ # View logs
197+ podman logs -f < container_id>
198+
199+ # Test the endpoint (note: using https)
200+ curl -k -X POST https://localhost:3080/ping
201+
202+ # Start Master Express container
203+ podman run -d \
204+ -p 3081:3081 \
205+ -v $( pwd) /certs:/app/certs:Z \
206+ -e APP_MODE=master-express \
207+ -e BIND=0.0.0.0 \
208+ -e TLS_MODE=mtls \
209+ -e TLS_KEY_PATH=/app/certs/test-ssl-key.pem \
210+ -e TLS_CERT_PATH=/app/certs/test-ssl-cert.pem \
211+ -e ENCLAVED_EXPRESS_URL=https://host.containers.internal:3080 \
212+ -e ENCLAVED_EXPRESS_CERT=/app/certs/enclaved-express-cert.pem \
213+ -e NODE_ENV=development \
214+ -e ALLOW_SELF_SIGNED=true \
215+ bitgo-onprem-express
216+
217+ # View logs
218+ podman logs -f < container_id>
219+
220+ # Test the endpoints (note: using https and mTLS)
221+ # For Enclaved Express
222+ curl -k --cert certs/test-ssl-cert.pem --key certs/enclaved-express-key.pem -X POST https://localhost:3080/ping
223+
224+ # For Master Express
225+ curl -k --cert certs/test-ssl-cert.pem --key certs/test-ssl-key.pem -X POST https://localhost:3081/ping
226+
227+ # Test the connection
228+ curl -k -X POST https://localhost:3081/ping/enclavedExpress
229+ ```
230+
231+ Notes:
232+ - ` host.containers.internal ` is a special DNS name that resolves to the host machine from inside containers
233+
234+
235+ ### Using Certificate Content as Environment Variables
236+ ``` bash
237+ podman run -d \
238+ -p 3080:3080 \
239+ -e APP_MODE=master-express \
240+ -e TLS_MODE=enabled \
241+ -e TLS_KEY=" $( cat path/to/your/key.pem) " \
242+ -e TLS_CERT=" $( cat path/to/your/cert.pem) " \
243+ bitgo-onprem-express
244+ ```
245+
246+ ### With mTLS Enabled
247+ ``` bash
248+ podman run -d \
249+ -p 3080:3080 \
250+ -v $( pwd) /certs:/app/certs:Z \
251+ -e APP_MODE=master-express \
252+ -e TLS_MODE=mtls \
253+ -e TLS_KEY_PATH=/app/certs/server-key.pem \
254+ -e TLS_CERT_PATH=/app/certs/server-cert.pem \
255+ -e MTLS_REQUEST_CERT=true \
256+ -e MTLS_ALLOWED_CLIENT_FINGERPRINTS=" fingerprint1,fingerprint2" \
257+ bitgo-master-express
258+ ```
259+
260+ Note:
261+ - The ` :Z ` option in volume mounts is specific to SELinux-enabled systems and ensures proper volume labeling
262+ - The logs directory will be created with appropriate permissions if it doesn't exist
263+
171264## API Endpoints
172265
173266### Enclaved Express (Port 3080)
0 commit comments