Dockerfile 1.58 KB
Newer Older
1 2 3 4
# Image for Cesium releases on Linux.
#
#
# Building this image:
5
#   docker build . --network=host -t duniter/cesium-plus-pod
6 7
#
# Test:
8
#   docker run --net=host -t duniter/cesium-plus-pod
9
# Test (interactive mode + bash mode):
10
#   docker run -i --net=host -t duniter/cesium-plus-pod bash
11 12 13 14
#
# Pull base image.
FROM airdock/oracle-jdk:1.8

Benoit Lavenier's avatar
Benoit Lavenier committed
15 16
ARG VERSION=1.1.3
ARG LIBSODIUM_VERSION=1.0.14
17 18 19 20 21 22 23 24 25 26 27 28 29 30

# Installing dependencies
RUN apt-get update && \
  apt-get --force-yes --yes install wget unzip build-essential

# Installing libsodium
RUN wget https://download.libsodium.org/libsodium/releases/libsodium-${LIBSODIUM_VERSION}.tar.gz && \
    tar -xzf libsodium-*.tar.gz && rm *.tar.gz && mv libsodium-* libsodium && \
    cd libsodium  && \
    ./configure && \
    make && make check && \
    make install

# Create compiling user
31 32 33 34
RUN mkdir /cesium-plus-pod && \
	adduser --system --group --quiet --shell /bin/bash --home /cesium-plus-pod cesium-plus-pod && \
	chown cesium-plus-pod:cesium-plus-pod /cesium-plus-pod
WORKDIR /cesium-plus-pod
35

36 37 38 39 40
RUN cd /cesium-plus-pod && \
    wget https://github.com/duniter/cesium-plus-pod/releases/download/cesium-plus-pod-${VERSION}/cesium-plus-pod-${VERSION}-standalone.zip && \
    unzip *.zip && rm *.zip && mv cesium-plus-pod-* cesium-plus-pod && \
    mkdir cesium-plus-pod/data && \
    chown -R cesium-plus-pod:cesium-plus-pod cesium-plus-pod
41

42
RUN ln -s /cesium-plus-pod/cesium-plus-pod/bin/elasticsearch /usr/bin/cesium-plus-pod
43

44
VOLUME /cesium-plus-pod/cesium-plus-pod
45 46
EXPOSE 9200 9400

47 48
USER cesium-plus-pod
WORKDIR /cesium-plus-pod
49

50
ENTRYPOINT ["/usr/bin/cesium-plus-pod"]
51
CMD []