Skip to content

Commit 506b8bd

Browse files
committed
init store in entrypoint
1 parent e28e061 commit 506b8bd

File tree

3 files changed

+34
-18
lines changed

3 files changed

+34
-18
lines changed

hugegraph-server/Dockerfile

+6-1
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,12 @@ RUN set -x \
4949
curl \
5050
lsof \
5151
vim \
52+
cron \
5253
&& apt-get clean \
5354
&& rm -rf /var/lib/apt/lists/*
5455

56+
RUN service cron start
57+
5558
# 2. Init HugeGraph Sever
5659
RUN set -e \
5760
&& pwd && cd /hugegraph-server/ \
@@ -61,10 +64,12 @@ RUN set -e \
6164
COPY hugegraph-server/hugegraph-dist/docker/scripts/remote-connect.groovy ./scripts
6265
COPY hugegraph-server/hugegraph-dist/docker/scripts/detect-storage.groovy ./scripts
6366
COPY hugegraph-server/hugegraph-dist/docker/docker-entrypoint.sh .
67+
COPY hugegraph-server/hugegraph-dist/docker/docker-init.sh .
6468
RUN chmod 755 ./docker-entrypoint.sh
69+
RUN chmod 755 ./docker-init.sh
6570

6671
EXPOSE 8080
6772
VOLUME /hugegraph-server
6873

69-
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
74+
ENTRYPOINT ["/usr/bin/dumb-init", "--" ,"/bin/bash", "docker-init.sh"]
7075
CMD ["./docker-entrypoint.sh"]

hugegraph-server/hugegraph-dist/docker/docker-entrypoint.sh

-17
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,6 @@
1616
# under the License.
1717
#
1818

19-
# wait for storage like cassandra
20-
./bin/wait-storage.sh
21-
22-
# set auth if needed
23-
if [[ $AUTH == "true" ]]; then
24-
# set password if use do not provide
25-
if [ -z "$PASSWORD" ]; then
26-
echo "you have not set the password, we will use the default password"
27-
PASSWORD="hugegraph"
28-
fi
29-
echo "init hugegraph with auth"
30-
./bin/enable-auth.sh
31-
echo "$PASSWORD" | ./bin/init-store.sh
32-
else
33-
./bin/init-store.sh
34-
fi
35-
3619
# start hugegraph
3720
# remove "-g zgc" now, which is only available on ARM-Mac with java > 13
3821
./bin/start-hugegraph.sh -j "$JAVA_OPTS"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one or more
4+
# contributor license agreements. See the NOTICE file distributed with this
5+
# work for additional information regarding copyright ownership. The ASF
6+
# licenses this file to You under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15+
# License for the specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
19+
# wait for storage backend
20+
./bin/wait-storage.sh
21+
22+
if [ -z "$PASSWORD" ]; then
23+
./bin/init-store.sh
24+
else
25+
echo "init hugegraph with auth"
26+
./bin/enable-auth.sh
27+
echo "$PASSWORD" | ./bin/init-store.sh
28+
fi

0 commit comments

Comments
 (0)