Skip to content
This repository has been archived by the owner on May 9, 2022. It is now read-only.

Piccolo script per avviare il container #330

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 17 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ istruzioni di seguito riportate.

## Installazione

### Docker (consigliata)
### Operazioni preliminari

1. Clonare il repository in locale

Expand All @@ -51,6 +51,20 @@ istruzioni di seguito riportate.
cd spid-testenv2
```

1. Generare una chiave privata ed un certificato

```shell
openssl req -x509 \
-nodes \
-sha256 \
-subj '/C=IT' \
-newkey rsa:2048 \
-keyout conf/idp.key \
-out conf/idp.crt
```

### Docker (consigliata)

1. Fare build dell'immagine

```shell
Expand All @@ -62,6 +76,8 @@ istruzioni di seguito riportate.
```shell
docker run -p 8088:8088 -v $(pwd)/conf:/app/conf italia/spid-testenv2
```

1. Per lanciare il container è anche possibile utilizzare lo script [startContainer.sh](startContainer.sh)

L'immagine `italia/spid-testenv2` a anche disponibile su [Docker Hub](https://hub.docker.com/).

Expand All @@ -87,18 +103,6 @@ L'immagine `italia/spid-testenv2` a anche disponibile su [Docker Hub](https://hu
pip install -r requirements.txt
```

1. Generare una chiave privata ed un certificato

```shell
openssl req -x509 \
-nodes \
-sha256 \
-subj '/C=IT' \
-newkey rsa:2048 \
-keyout conf/idp.key \
-out conf/idp.crt
```

1. Creare e modificare il file config.yaml secondo le esigenze.

```shell
Expand Down
15 changes: 15 additions & 0 deletions startContainer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

NAME="test_spid_ip"

ExistingContainer="$(docker ps --filter name="$NAME" -q -a)"

if [[ ! -z "$ExistingContainer" ]]; then
RunningCointainer="$(docker ps --filter name="$NAME" -q)"
if [[ ! -z "$RunningCointainer" ]]; then
docker kill "$RunningCointainer"
fi
docker start "$NAME"
else
docker run --name "$NAME" -d -p 8088:8088 -v $(pwd)/conf:/app/conf italia/spid-testenv2
fi