-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
executable file
·63 lines (55 loc) · 1.62 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
61
62
63
#!/usr/bin/env bash
export PGPASSWORD=transitclock
export PGUSERNAME=postgres
docker stop transitclock-db && docker stop transitclock-server-instance
docker rm transitclock-db && docker rm transitclock-server-instance
docker rmi transitclock-server
# Builds image from Dockerfile
docker build --no-cache -t transitclock-server .
# Initiates the database container
docker run \
--name transitclock-db \
-p 5432:5432 \
-e POSTGRES_PASSWORD="${PGPASSWORD}" \
-e POSTGRES_USER="${PGUSERNAME}" \
-d \
postgres:9.6.12
# Check that the database is up
docker run \
--name transitclock-server-instance \
--rm \
--link transitclock-db:postgres \
-e PGPASSWORD="${PGPASSWORD}" \
-e PGUSERNAME="${PGUSERNAME}" \
transitclock-server \
check_db_up.sh
# Sets up the database and necessary stuff
docker run \
--name transitclock-server-instance \
--rm \
--link transitclock-db:postgres \
-e PGPASSWORD="${PGPASSWORD}" \
-e PGUSERNAME="${PGUSERNAME}" \
transitclock-server \
agency-looper.runtime.tables.sh
# Sets up the database and necessary stuff
docker run \
--name transitclock-server-instance \
--rm \
--link transitclock-db:postgres \
-v /opt/gtfs:/usr/local/transitclock/gtfs \
-e PGPASSWORD="${PGPASSWORD}" \
-e PGUSERNAME="${PGUSERNAME}" \
transitclock-server \
agency-looper.runtime.gtfs.sh
# Starts TransitClock cores
docker run \
--name transitclock-server-instance \
--rm \
--link transitclock-db:postgres \
-v /opt/gtfs:/usr/local/transitclock/gtfs \
-e PGPASSWORD="${PGPASSWORD}" \
-e PGUSERNAME="${PGUSERNAME}" \
-p 3020:8080 \
transitclock-server \
agency-looper.start.sh