Skip to content

Commit 86a0ca3

Browse files
committed
sztp: use postgresql
Fixes #104 Signed-off-by: Boris Glimcher <[email protected]>
1 parent edfe8e8 commit 86a0ca3

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

integration/docker-compose.pxe.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,38 @@ services:
3535
build:
3636
context: pxe
3737
dockerfile: Dockerfile.sztp
38+
depends_on:
39+
- db
3840
environment:
3941
SZTPD_INIT_PORT: 1080
4042
SZTPD_INIT_MODE: 1
4143
SZTPD_ACCEPT_CONTRACT: "Yes"
4244
network_mode: service:pxe
43-
command: ['sztpd', 'sqlite:///:memory:']
45+
command: ['sztpd', 'postgresql://sztpd-admin:secret@localhost:5432/sztpd-db']
4446
healthcheck:
4547
test: curl --silent --fail -H Accept:application/yang-data+json http://localhost:1080/.well-known/host-meta || exit 1
4648
interval: 6s
4749
timeout: 10s
4850
retries: 5
4951

52+
db:
53+
image: postgres:9.5
54+
volumes:
55+
- sztp_data:/var/lib/postgresql/data
56+
environment:
57+
POSTGRES_DB: sztpd-db
58+
POSTGRES_USER: sztpd-admin
59+
POSTGRES_PASSWORD: secret
60+
network_mode: service:pxe
61+
healthcheck:
62+
test: ["CMD", "pg_isready", "-U", "sztpd-admin"]
63+
interval: 30s
64+
timeout: 30s
65+
retries: 3
66+
67+
volumes:
68+
sztp_data: {}
69+
5070
networks:
5171
opi:
5272
name: opi

integration/pxe/Dockerfile.sztp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
FROM python:3.9
2-
RUN pip install sztpd==0.0.11
2+
RUN pip install sztpd==0.0.11 psycopg2-binary==2.9.3

0 commit comments

Comments
 (0)