Skip to content

Commit bc4eb58

Browse files
committed
Restrict Docker services to localhost
1 parent e80729f commit bc4eb58

1 file changed

Lines changed: 14 additions & 40 deletions

File tree

docker-compose.yml

Lines changed: 14 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,63 @@
1-
services:
1+
services:
22
hybrid-pki-api:
33
build:
44
context: .
55
dockerfile: Dockerfile
66
container_name: hybrid-pki-api
77
ports:
8-
- "8000:8000"
8+
- "127.0.0.1:8000:8000"
99
volumes:
1010
- ./certs:/app/certs
1111
- ./logs:/app/logs
12-
- ./docs:/app/docs
12+
- ./docs:/app/docs:ro
1313
environment:
14-
APP_NAME: "Hybrid-PKI-Lab"
1514
APP_ENV: "development"
16-
API_HOST: "0.0.0.0"
17-
API_PORT: "8000"
18-
PKI_STORAGE_PATH: "/app/certs"
19-
LOG_LEVEL: "INFO"
2015
HYBRID_PKI_DISABLE_OQS: "1"
21-
command: uvicorn hybrid_pki.api.main:app --host 0.0.0.0 --port 8000 --reload
16+
HYBRID_PKI_ENABLE_MUTATIONS: "${HYBRID_PKI_ENABLE_MUTATIONS:-0}"
17+
HYBRID_PKI_API_KEY: "${HYBRID_PKI_API_KEY:-}"
18+
command: uvicorn hybrid_pki.api.main:app --host 0.0.0.0 --port 8000
2219

2320
hybrid-pki-tests:
2421
build:
2522
context: .
2623
dockerfile: Dockerfile
27-
container_name: hybrid-pki-tests
2824
volumes:
2925
- .:/app
3026
environment:
3127
APP_ENV: "test"
32-
PKI_STORAGE_PATH: "/app/certs"
3328
HYBRID_PKI_DISABLE_OQS: "1"
29+
HYBRID_PKI_ENABLE_MUTATIONS: "1"
3430
command: pytest -v --cov=hybrid_pki --cov-report=term-missing
35-
profiles:
36-
- test
37-
38-
hybrid-pki-shell:
39-
build:
40-
context: .
41-
dockerfile: Dockerfile
42-
container_name: hybrid-pki-shell
43-
volumes:
44-
- .:/app
45-
environment:
46-
APP_ENV: "development"
47-
PKI_STORAGE_PATH: "/app/certs"
48-
HYBRID_PKI_DISABLE_OQS: "1"
49-
entrypoint: /bin/bash
50-
profiles:
51-
- shell
31+
profiles: [test]
5232

5333
hybrid-pki-pqc:
5434
build:
5535
context: .
5636
dockerfile: Dockerfile.pqc
5737
container_name: hybrid-pki-pqc
5838
ports:
59-
- "8001:8000"
39+
- "127.0.0.1:8001:8000"
6040
volumes:
6141
- ./certs:/app/certs
6242
- ./logs:/app/logs
6343
- ./benchmarks/results:/app/benchmarks/results
6444
environment:
65-
APP_NAME: "Hybrid-PKI-Lab"
6645
APP_ENV: "pqc"
67-
API_HOST: "0.0.0.0"
68-
API_PORT: "8000"
69-
PKI_STORAGE_PATH: "/app/certs"
70-
LOG_LEVEL: "INFO"
7146
HYBRID_PKI_DISABLE_OQS: "0"
47+
HYBRID_PKI_ENABLE_MUTATIONS: "${HYBRID_PKI_ENABLE_MUTATIONS:-0}"
48+
HYBRID_PKI_API_KEY: "${HYBRID_PKI_API_KEY:-}"
7249
command: uvicorn hybrid_pki.api.main:app --host 0.0.0.0 --port 8000
73-
profiles:
74-
- pqc
50+
profiles: [pqc]
7551

7652
hybrid-pki-pqc-tests:
7753
build:
7854
context: .
7955
dockerfile: Dockerfile.pqc
80-
container_name: hybrid-pki-pqc-tests
8156
volumes:
8257
- .:/app
8358
environment:
8459
APP_ENV: "pqc-test"
85-
PKI_STORAGE_PATH: "/app/certs"
8660
HYBRID_PKI_DISABLE_OQS: "0"
61+
HYBRID_PKI_ENABLE_MUTATIONS: "1"
8762
command: pytest -v
88-
profiles:
89-
- pqc-test
63+
profiles: [pqc-test]

0 commit comments

Comments
 (0)