Skip to content

Commit 6e47bce

Browse files
authored
feat: Update example to be a remote signer example
feat: Update example to be a remote signer example
2 parents fe28799 + c5996a7 commit 6e47bce

20 files changed

+1283
-105
lines changed

.dockerignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.gitignore
2+
*.md
3+
docker-compose.yml
4+
example-env.env
5+
LICENSE
6+
README.md
7+
*.txt
8+
!requirements.txt
9+
Makefile
10+
volume/
11+
local_volume/
12+
client_volume/

.env.local

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
RUN_MODE=DEV
2+
AWS_ENDPOINT_URL=http://localstack:4566
3+
AWS_REGION=us-east-1

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
__pycache__/
2+
c2pa-env
3+
*.env
4+
!.env.local
25
chain.pem
36
config.json
47
kms-signing.crt
58
kms-signing.csr
69
rootCA.crt
710
rootCA.key
11+
target/
12+
out-images/
13+
.DS_Store
14+
volume/
15+
local_volume/
16+
client_volume/
17+
config_volume/
18+
tests/test-certs/*
19+
!tests/test-certs/.gitkeep
20+
!example.env
21+
!env-var-documentation.env

Dockerfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM python:3.12 AS build
2+
3+
WORKDIR /usr/src/app
4+
5+
COPY requirements.txt ./
6+
RUN pip install --no-cache-dir -r requirements.txt
7+
COPY . .
8+
9+
ENTRYPOINT [ "python" ]
10+
11+
12+
FROM build AS app
13+
14+
ENTRYPOINT [ "python", "app.py" ]
15+
16+
17+
FROM build AS client
18+
19+
ENTRYPOINT [ "python", "tests/client.py", "./tests/A.jpg", "-o", "client_volume/signed-images" ]
20+
21+
22+
FROM build AS local-setup
23+
24+
RUN apt-get update \
25+
&& apt-get install -y \
26+
less \
27+
jq
28+
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip" \
29+
&& unzip awscliv2.zip \
30+
&& ./aws/install
31+
RUN python3 -m pip install --upgrade localstack
32+
RUN pip install awscli-local[ver2]
33+
34+
ENTRYPOINT [ "bash", "./local-setup.sh" ]

Makefile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
title = "\n---$(shell tput bold)$(shell tput setaf 2)$1 $(shell tput sgr0)\n"
22

3-
init:
4-
@echo $(call title, "Generating KMS key and CMS cert.......")
5-
63
build:
7-
@echo $(call title, "Building container........")
4+
@echo $(call title, "Building containers........")
5+
docker compose build
86

97
run:
10-
@echo $(call title, "Running container.........")
8+
@echo $(call title, "Running containers.........")
9+
docker compose up -d
10+
11+
local: build run
1112

12-
dev: init build
13+
clean:
14+
@echo $(call title, "Cleaning up.................")
15+
docker compose down --volumes --remove-orphans

0 commit comments

Comments
 (0)