-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Junqiu Lei <[email protected]>
- Loading branch information
1 parent
56f7d41
commit 1aef822
Showing
5 changed files
with
41 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules | ||
npm-debug.log | ||
dist | ||
dist | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules | ||
npm-debug.log | ||
dist | ||
dist | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,47 @@ | ||
# Copyright OpenSearch Contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
########################### Stage 0 ######################## | ||
FROM amazonlinux:2 AS stage_0 | ||
|
||
WORKDIR /src | ||
|
||
RUN yum install -y tar gzip unzip && yum clean all | ||
|
||
RUN mkdir GeoJSONData && \ | ||
cd GeoJSONData && \ | ||
curl -SL -o geo-json-files.tar.gz https://maps.opensearch.org/offline/natural-earth-geo-json.tar.gz && \ | ||
tar -xzf geo-json-files.tar.gz --strip-components=1 && \ | ||
rm geo-json-files.tar.gz && pwd && ls | ||
|
||
RUN mkdir oss_compliance && \ | ||
cd oss_compliance && \ | ||
curl -SL -o oss_compliance.zip https://aws-dlinfra-utilities.s3.amazonaws.com/oss_compliance.zip && \ | ||
unzip oss_compliance.zip && \ | ||
rm oss_compliance.zip | ||
|
||
########################### Stage 1 ######################## | ||
FROM amazonlinux:2 | ||
|
||
WORKDIR /usr/src/app | ||
|
||
RUN curl -sL https://rpm.nodesource.com/setup_16.x | bash - && \ | ||
yum install -y nodejs wget tar gzip unzip python37 && \ | ||
yum clean all | ||
COPY --from=stage_0 /src/GeoJSONData public/vectors/data | ||
COPY --from=stage_0 /src/oss_compliance . | ||
|
||
RUN pip3 install --no-cache --upgrade \ | ||
"requests>=2.18.4,<=2.22.0" | ||
RUN curl -SL https://rpm.nodesource.com/setup_16.x | bash && \ | ||
yum install -y nodejs-16.17.1 python3 tar gzip && pip3 install requests==2.28.1 && yum clean all | ||
|
||
COPY package*.json ./ | ||
RUN npm install | ||
COPY . . | ||
|
||
RUN mkdir -p public/vectors/data && \ | ||
cd public/vectors/data && \ | ||
wget -O vectors.tar.gz https://maps.opensearch.org/offline/natural-earth-geo-json.tar.gz && \ | ||
tar -xzf vectors.tar.gz --strip-components=1 && \ | ||
rm vectors.tar.gz | ||
|
||
COPY entrypoint.sh . | ||
RUN chmod +x entrypoint.sh | ||
ENTRYPOINT ["./entrypoint.sh"] | ||
|
||
EXPOSE 8080 | ||
RUN chmod +x oss_compliance/generate_oss_compliance.sh && \ | ||
oss_compliance/generate_oss_compliance.sh /usr/src/app python3 && \ | ||
cp oss_compliance/python_packages/piplicenses/PACKAGES_LICENSES_JSON.json PACKAGES_LICENSES_JSON.json && \ | ||
rm -rf oss_compliance* \ | ||
|
||
RUN wget -O oss_compliance.zip https://aws-dlinfra-utilities.s3.amazonaws.com/oss_compliance.zip \ | ||
&& unzip oss_compliance.zip \ | ||
&& chmod +x oss_compliance/generate_oss_compliance.sh \ | ||
&& oss_compliance/generate_oss_compliance.sh /usr/src/app python3 \ | ||
&& cp oss_compliance/python_packages/piplicenses/PACKAGES_LICENSES_JSON.json PACKAGES_LICENSES_JSON.json \ | ||
&& rm -rf oss_compliance* | ||
EXPOSE 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters