This repository was archived by the owner on Dec 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·52 lines (47 loc) · 1.43 KB
/
run.sh
File metadata and controls
executable file
·52 lines (47 loc) · 1.43 KB
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
#! /bin/bash
if which composer; then
# We have composer, so install on the host.
cd server
composer install
cd ..
cd pubsub
composer install
cd ..
cd tilmeld-server
composer install
cd ..
else
# No composer on the host, so install with Docker image.
if docker run -it --rm -v $PWD/server:/app composer install; then
# Make sure the files are owned by the user.
docker run -it --rm -v $PWD/server:/app ubuntu chown -R $(id -u):$(id -g) /app/vendor
else
echo "Failed to install PHP libraries."
exit 1
fi
if docker run -it --rm -v $PWD/pubsub:/app composer install; then
# Make sure the files are owned by the user.
docker run -it --rm -v $PWD/pubsub:/app ubuntu chown -R $(id -u):$(id -g) /app/vendor
else
echo "Failed to install PHP libraries."
exit 1
fi
if docker run -it --rm -v $PWD/tilmeld-server:/app composer install; then
# Make sure the files are owned by the user.
docker run -it --rm -v $PWD/tilmeld-server:/app ubuntu chown -R $(id -u):$(id -g) /app/vendor
else
echo "Failed to install PHP libraries."
exit 1
fi
fi
if [ ! -f "tilmeld_secret.txt" ]; then
dd if=/dev/urandom bs=32 count=1 | base64 > ./tilmeld_secret.txt
fi
if [ ! -d "db_data" ]; then
mkdir db_data
fi
if [ ! -f "wait-for-it.sh" ]; then
curl https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh -o wait-for-it.sh
chmod 755 ./wait-for-it.sh
fi
docker-compose up