Skip to content

Commit 8586014

Browse files
committed
fhfghfg
1 parent a275125 commit 8586014

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

docker-compose-mysql-wf.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: '2.0'
2+
services:
3+
logicaldoc:
4+
depends_on:
5+
- lddb
6+
command: ["./wait-for-it.sh", "mysql-ld:3306", "-t", "30", "--", "/opt/logicaldoc/start-logicaldoc.sh", "run"]
7+
image: logicaldoc-ce
8+
restart: always
9+
ports:
10+
- 8080:8080
11+
environment:
12+
- LDOC_MEMORY=2000
13+
14+
lddb:
15+
container_name: mysql-ld
16+
image: mysql:5.7
17+
restart: always
18+
environment:
19+
- MYSQL_ROOT_PASSWORD=example
20+
- MYSQL_DATABASE=logicaldoc
21+
- MYSQL_USER=ldoc
22+
- MYSQL_PASSWORD=changeme

wait-for-mysql.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -x
5+
6+
host="$1"
7+
shift
8+
cmd="$@"
9+
10+
until mysql -h "$host" -u ${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE} -e 'select 1'; do
11+
>&2 echo "MySQL is unavailable - sleeping"
12+
sleep 1
13+
done
14+
15+
>&2 echo "Mysql is up - executing command"
16+
exec $cmd

wait-for-postgres.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
# wait-for-postgres.sh
3+
4+
set -e
5+
6+
host="$1"
7+
shift
8+
cmd="$@"
9+
10+
until psql -h "$host" -U "postgres" -c '\q'; do
11+
>&2 echo "Postgres is unavailable - sleeping"
12+
sleep 1
13+
done
14+
15+
>&2 echo "Postgres is up - executing command"
16+
exec $cmd

0 commit comments

Comments
 (0)