File tree 6 files changed +90
-102
lines changed
6 files changed +90
-102
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ version : ' 3.5'
2
+
3
+ services :
4
+ web :
5
+ build : .
6
+
7
+ celery :
8
+ build : .
Original file line number Diff line number Diff line change 1
1
version : ' 3.5'
2
2
3
3
x-environment-vars : &environment-vars
4
+ POSTGRES_HOST : postgres
4
5
DATABASE_URL : postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
5
- ELASTICSEARCH_HOST : elastic:9200
6
6
REDIS_URL : redis://redis:6379/0
7
7
ADMIN_EMAIL : " @{ADMIN_EMAIL}"
8
8
ADMIN_PASSWORD : " @{ADMIN_PASSWORD}"
9
9
10
10
x-defaults : &defaults
11
- build : .
11
+ image : eventyay/open-event-server
12
12
restart : unless-stopped
13
13
environment :
14
14
<< : *environment-vars
15
15
depends_on :
16
16
- postgres
17
17
- redis
18
- - elastic
19
- links :
20
- - postgres:postgres
21
- - redis:redis
22
- - elastic:elastic
23
18
volumes :
24
19
- ./static:/data/app/static
25
20
@@ -44,18 +39,6 @@ services:
44
39
volumes :
45
40
- rd:/var/lib/redis/data
46
41
47
- elastic :
48
- image : elasticsearch:5.6.12-alpine
49
- container_name : opev-elastic-search
50
- restart : unless-stopped
51
- environment :
52
- - discovery.type=single-node
53
- volumes :
54
- - es:/usr/share/elasticsearch/data
55
- ports :
56
- - 9200:9200
57
- - 9300:9300
58
-
59
42
web :
60
43
<< : *defaults
61
44
container_name : opev-web
@@ -73,4 +56,3 @@ services:
73
56
volumes :
74
57
pg :
75
58
rd :
76
- es :
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ echo "[LOG] Using redis: ${REDIS_URL}"
7
7
8
8
if [ " $DEPLOYMENT " == " api" ]
9
9
then
10
+ echo " [LOG] Waiting for Database" && ./scripts/wait-for.sh ${POSTGRES_HOST} :5432 --timeout=60 -- echo " [LOG] Database Up"
10
11
echo " [LOG] Preparing database"
11
12
python manage.py prepare_kubernetes_db
12
13
echo " [LOG] Running migrations"
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ TIMEOUT=15
4
+ QUIET=0
5
+
6
+ echoerr () {
7
+ if [ " $QUIET " -ne 1 ]; then printf " %s\n" " $* " 1>&2 ; fi
8
+ }
9
+
10
+ usage () {
11
+ exitcode=" $1 "
12
+ cat << USAGE >&2
13
+ Usage:
14
+ $cmdname host:port [-t timeout] [-- command args]
15
+ -q | --quiet Do not output any status messages
16
+ -t TIMEOUT | --timeout=timeout Timeout in seconds, zero for no timeout
17
+ -- COMMAND ARGS Execute command with args after the test finishes
18
+ USAGE
19
+ exit " $exitcode "
20
+ }
21
+
22
+ wait_for () {
23
+ for i in ` seq $TIMEOUT ` ; do
24
+ nc -z " $HOST " " $PORT " > /dev/null 2>&1
25
+
26
+ result=$?
27
+ if [ $result -eq 0 ] ; then
28
+ if [ $# -gt 0 ] ; then
29
+ exec " $@ "
30
+ fi
31
+ exit 0
32
+ fi
33
+ sleep 1
34
+ done
35
+ echo " Operation timed out" >&2
36
+ exit 1
37
+ }
38
+
39
+ while [ $# -gt 0 ]
40
+ do
41
+ case " $1 " in
42
+ * :* )
43
+ HOST=$( printf " %s\n" " $1 " | cut -d : -f 1)
44
+ PORT=$( printf " %s\n" " $1 " | cut -d : -f 2)
45
+ shift 1
46
+ ;;
47
+ -q | --quiet)
48
+ QUIET=1
49
+ shift 1
50
+ ;;
51
+ -t)
52
+ TIMEOUT=" $2 "
53
+ if [ " $TIMEOUT " = " " ]; then break ; fi
54
+ shift 2
55
+ ;;
56
+ --timeout=* )
57
+ TIMEOUT=" ${1#* =} "
58
+ shift 1
59
+ ;;
60
+ --)
61
+ shift
62
+ break
63
+ ;;
64
+ --help)
65
+ usage 0
66
+ ;;
67
+ * )
68
+ echoerr " Unknown argument: $1 "
69
+ usage 1
70
+ ;;
71
+ esac
72
+ done
73
+
74
+ if [ " $HOST " = " " -o " $PORT " = " " ]; then
75
+ echoerr " Error: you need to provide a host and port to test."
76
+ usage 2
77
+ fi
78
+
79
+ wait_for " $@ "
You can’t perform that action at this time.
0 commit comments