forked from ropensci/fishbaseapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker.sh
executable file
·48 lines (34 loc) · 1.14 KB
/
docker.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
#!/bin/bash
# Remove any versions of running containers first
docker rm -f -v fbredis fbmysql slbmysql fbapi fbnginx
# Make sure services are up-to-date
docker pull redis:latest
docker pull mysql:latest
docker pull nginx:latest
## Start some services: redis, elasticsearch, logstash, freegeoip
docker run --name fbredis -d redis:latest
######### FishBase DataBase ##################
docker run --name fbmysql \
--restart=always -d \
-v $HOME/data/fishbase:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD=root \
mysql:latest
###### SeaLifeBase DataBase & API ############
docker run --name slbmysql \
--restart=always -d \
-v $HOME/data/sealifebase:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD=root \
mysql:latest
docker build -t ropensci/fishbaseapi:latest .
docker run --name fbapi -d \
--link slbmysql:sealifebase \
--link fbmysql:mysql \
--link fbredis:redis \
ropensci/fishbaseapi:latest
# Must generate a .htpassword file first:
# assuming apache2-utils is installed: sudo htpasswd -cb .htpasswd $USER $PASSWORD
docker run --name fbnginx -d \
-p 80:80 \
--link fbapi:api \
-v ${PWD}/nginx.conf:/etc/nginx/nginx.conf \
nginx:latest