-
Notifications
You must be signed in to change notification settings - Fork 49
/
Dockerfile
62 lines (53 loc) · 2.11 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# syntax=docker/dockerfile:1
FROM amazonlinux:2023
ARG NEPTUNE_NOTEBOOK
ENV NVM_DIR=/root/.nvm
ENV NODE_VERSION=v22.11.0
ENV NEPTUNE_NOTEBOOK=$NEPTUNE_NOTEBOOK
ENV HOME=/graph-explorer
# Conditionally set the following environment values using +/- variable expansion
# https://docs.docker.com/reference/dockerfile/#environment-replacement
#
# If NEPTUNE_NOTEBOOK value is set then
# - GRAPH_EXP_ENV_ROOT_FOLDER = /proxy/9250/explorer
# - PROXY_SERVER_HTTP_PORT = 9250
# - LOG_STYLE = cloudwatch
# Else the values are the defaults
# - GRAPH_EXP_ENV_ROOT_FOLDER = /explorer
# - PROXY_SERVER_HTTP_PORT = 80
# - LOG_STYLE = default
ENV GRAPH_EXP_ENV_ROOT_FOLDER=${NEPTUNE_NOTEBOOK:+/proxy/9250/explorer}
ENV GRAPH_EXP_ENV_ROOT_FOLDER=${GRAPH_EXP_ENV_ROOT_FOLDER:-/explorer}
ENV PROXY_SERVER_HTTP_PORT=${NEPTUNE_NOTEBOOK:+9250}
ENV PROXY_SERVER_HTTP_PORT=${PROXY_SERVER_HTTP_PORT:-80}
ENV LOG_STYLE=${NEPTUNE_NOTEBOOK:+cloudwatch}
ENV LOG_STYLE=${LOG_STYLE:-default}
WORKDIR /
COPY . /graph-explorer/
WORKDIR /graph-explorer
# Keeping all the RUN commands on a single line reduces the number of layers and,
# as a result, significantly reduces the final image size.
RUN yum update -y && \
yum install -y tar gzip git findutils openssl && \
mkdir -p $NVM_DIR && \
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash && \
source $NVM_DIR/nvm.sh && \
nvm install $NODE_VERSION && \
nvm alias default $NODE_VERSION && \
nvm use $NODE_VERSION && \
corepack enable && \
pnpm install && \
pnpm build && pnpm clean:dep && pnpm install --prod --ignore-scripts && \
yum clean all && \
yum remove -y tar gzip findutils git && \
rm -rf /var/cache/yum && \
rm -rf $HOME/.local && \
chmod a+x ./process-environment.sh && \
chmod a+x ./docker-entrypoint.sh
# Set node/npm in path so it can be used by the app when the container is run
ENV NODE_PATH=$NVM_DIR/versions/node/$NODE_VERSION/lib/node_modules
ENV PATH=$NVM_DIR/versions/node/$NODE_VERSION/bin:$PATH
EXPOSE 443
EXPOSE 80
EXPOSE 9250
ENTRYPOINT ["./docker-entrypoint.sh"]