forked from docdoku/docdoku-plm-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
executable file
·60 lines (52 loc) · 1.11 KB
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh
#
# This script:
#
# - Creates the data directory (uploaded files)
# - Generates a keystore (needed for docdoku-plm-server)
# - Pull images and starts all containers
# Exit on error
set -e
# Change this values in production
STOREPASS=changeit
KEYPASS=changeit
KEYALIAS=mykeyalias
STORETYPE=PKCS12
KEYALG=AES
KEYSIZE=256
#
# Script start
#
# Data directory check
if [ -d data ];
then
echo 'Data directory found'
else
echo 'Creating data directory and volume...'
mkdir data
docker volume create --driver local \
--opt type=none \
--opt device=$(pwd)/data \
--opt o=bind docdoku-plm-server-volume
fi
echo $(pwd)/data
# Keystore check
if [ -f keystore ];
then
echo 'Keystore found'
else
echo 'Generating keystore...'
keytool \
-genseckey \
-keystore $(pwd)/keystore \
-storetype ${STORETYPE} \
-alias ${KEYALIAS} \
-keyalg ${KEYALG} \
-keysize ${KEYSIZE} \
-storepass ${STOREPASS} \
-keypass ${KEYPASS}
fi
echo $(pwd)/keystore
# Start the containers
docker-compose pull
docker-compose up -d --force-recreate --remove-orphans