Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Dockerfile for server & studio (0.10) #845

Merged
merged 10 commits into from
Nov 20, 2020
Merged
51 changes: 51 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
FROM ubuntu:xenial
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also support centos?

Copy link
Member Author

@imbajin imbajin Feb 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can only write a basically similar Dockerfile for CentOS. (Generally use Debian/Ubuntu)
Usually , I haven't seen the official image provide two types of Dockerfile,
Maybe we can see the opinions of other community users.

And here are some refers:

  1. Cassandra_Dockerfile
  2. Nginx_Dockerfile
  3. Other Official Dockerfile

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK


LABEL maintainer="HugeGraph Docker Maintainers <[email protected]>"

ENV PKG_URL https://github.com/hugegraph

# 1. Install needed dependencies of GraphServer & RocksDB
RUN set -x \
&& apt-get -q update \
&& apt-get -q install -y --no-install-recommends --no-install-suggests \
curl \
lsof \
g++ \
gcc \
openjdk-8-jdk \
&& apt-get clean
# && rm -rf /var/lib/apt/lists/*

# 2. Init HugeGraph Sever
# (Optional) You can set the ip of github to speed up the local build
# && echo "192.30.253.112 github.com\n151.101.44.249 github.global.ssl.fastly.net" >> /etc/hosts \
ENV SERVER_VERSION 0.10.4
RUN set -e \
&& mkdir -p /root/hugegraph-server \
&& curl -L -S ${PKG_URL}/hugegraph/releases/download/v${SERVER_VERSION}/hugegraph-${SERVER_VERSION}.tar.gz -o /root/server.tar.gz \
&& tar xzf /root/server.tar.gz --strip-components 1 -C /root/hugegraph-server \
&& rm /root/server.tar.gz \
&& cd /root/hugegraph-server/ \
&& sed -i "s/^restserver.url.*$/restserver.url=http:\/\/0.0.0.0:8080/g" ./conf/rest-server.properties \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can it be a real ip instead of 0.0.0.0

&& sed -n '63p' ./bin/start-hugegraph.sh | grep "&" > /dev/null && sed -i 63{s/\&$/#/g} ./bin/start-hugegraph.sh \
&& sed -n '74p' ./bin/start-hugegraph.sh | grep "exit" > /dev/null && sed -i 74{s/^/#/g} ./bin/start-hugegraph.sh \
&& ./bin/init-store.sh
Copy link
Contributor

@javeme javeme Feb 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a shell install-server.sh to improve readability?
some references found https://github.com/search?l=Dockerfile&p=99&q=RUN++install.sh&type=Code

Copy link
Member Author

@imbajin imbajin Feb 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need test it:
if there is a file named start.sh

echo "old msg"
  1. RUN start.sh
  2. RUN echo "old msg" && echo "new msg"

If we use a shell file to change the code, would dockerfile think this is a repeated step and skip the rebuild?


# 3. Prepare for HugeGraph Studio
ENV STUDIO_VERSION 0.10.0
# (Optional) You can set the ip of github to speed up the local build
# && echo "192.30.253.112 github.com\n151.101.44.249 github.global.ssl.fastly.net" >> /etc/hosts \
RUN set -e \
&& mkdir -p /root/hugegraph-studio \
&& curl -L -S ${PKG_URL}/hugegraph-studio/releases/download/v${STUDIO_VERSION}/hugegraph-studio-${STUDIO_VERSION}.tar.gz -o /root/studio.tar.gz \
&& tar xzf /root/studio.tar.gz --strip-components 1 -C /root/hugegraph-studio \
&& rm /root/studio.tar.gz \
&& cd /root/hugegraph-studio/ \
&& sed -i "s/^studio.server.host.*$/studio.server.host=0.0.0.0/g" ./conf/hugegraph-studio.properties \
&& sed -i "s/^graph.server.host.*$/graph.server.host=0.0.0.0/g" ./conf/hugegraph-studio.properties

EXPOSE 8080 8088
WORKDIR /root
VOLUME /root

ENTRYPOINT ["./hugegraph-server/bin/start-hugegraph.sh"]
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ cassandra.password=
# hbase backend config
#hbase.hosts=localhost
#hbase.port=2181
#hbase.znode_parent=/hbsae
#hbase.znode_parent=/hbase
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also move it to independent commit

#hbase.threads_max=64

# mysql backend config
Expand Down