Skip to content

Commit

Permalink
Update Dockerfile base image to AL2022 (#190)
Browse files Browse the repository at this point in the history
* Move Dockerfile base image to AL2022

* update changelog
  • Loading branch information
michaelnchin authored Sep 13, 2023
1 parent bde39c6 commit 41e77e6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The next release will include the following feature enhancements and bug fixes:
- Added toggle for limit on retrieved vertex neighbors (https://github.com/aws/graph-explorer/pull/176)
- Added SageMaker Notebook hosting documentation (https://github.com/aws/graph-explorer/pull/183)
- Added ECS hosting documentation (https://github.com/aws/graph-explorer/pull/174)
- Updated Dockerfile base image to AL2022 (https://github.com/aws/graph-explorer/pull/190)

**Bug fixes**
- Fixed search UI crashing on node select/preview (https://github.com/aws/graph-explorer/pull/177)
Expand Down
26 changes: 22 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
# syntax=docker/dockerfile:1
FROM amazonlinux:2
FROM amazonlinux:2022
ARG NEPTUNE_NOTEBOOK
ENV NVM_DIR /root/.nvm
ENV NODE_VERSION v16.20.2
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 curl -sL https://rpm.nodesource.com/setup_16.x | bash - && yum install -y nodejs openssl && npm install -g pnpm && pnpm install && rm -rf /var/cache/yum && chmod a+x ./process-environment.sh
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.5/install.sh | bash && \
source $NVM_DIR/nvm.sh && \
nvm install $NODE_VERSION && \
nvm alias default $NODE_VERSION && \
nvm use $NODE_VERSION && \
npm install -g pnpm && \
pnpm install && \
yum clean all && \
yum remove -y tar gzip findutils && \
rm -rf /var/cache/yum && \
chmod a+x ./process-environment.sh
# Set node/npm in path so we can reuse it in the next run layer
ENV NODE_PATH $NVM_DIR/versions/node/$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/$NODE_VERSION/bin:$PATH
WORKDIR /graph-explorer/
ENV HOME=/graph-explorer
ENV NEPTUNE_NOTEBOOK=$NEPTUNE_NOTEBOOK
RUN if [ -n "$NEPTUNE_NOTEBOOK" ] && [ "$NEPTUNE_NOTEBOOK" = "true" ]; then \
echo "GRAPH_EXP_ENV_ROOT_FOLDER=/proxy/9250/explorer" >> ./packages/graph-explorer/.env; \
else \
echo "GRAPH_EXP_ENV_ROOT_FOLDER=/explorer" >> ./packages/graph-explorer/.env; \
fi
RUN pnpm build
fi && \
pnpm build
EXPOSE 443
EXPOSE 80
EXPOSE 9250
Expand Down

0 comments on commit 41e77e6

Please sign in to comment.