-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sh
More file actions
29 lines (26 loc) · 833 Bytes
/
init.sh
File metadata and controls
29 lines (26 loc) · 833 Bytes
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
#! /bin/bash
PORT=9999
while getopts ":h:p" opt; do
case {$opt} in
h )
echo "Creates docker container hosting network traffic database."
echo "Port number may be specified with the -p flag (default 9999)."
;;
p )
PORT=$OPTARG
;;
\? )
echo "invalid argument: -$OPTARG" 1>&2
;;
esac
done
mkdir clean_data
aws s3 sync --no-sign-request "s3://cse-cic-ids2018/Processed Traffic Data for ML Algorithms" data
cd data
python ../create_tables.py clean_data
cd ..
echo "building docker image..."
sudo docker build -t nettrafficdb .
echo "creating database container..."
sudo docker run --name NetTrafficClassifier -p $PORT:5432 -v "$(pwd)"/clean_data:/clean_data -d nettrafficdb
echo "database now listening on port $PORT"