/
Dockerfile-multistage-node
55 lines (45 loc) · 1.99 KB
/
Dockerfile-multistage-node
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
FROM node:14.14.0 as node-build
ADD . /hydroshare
WORKDIR /hydroshare/hs_discover
RUN rm -rf static templates && \
mkdir static templates && \
mkdir templates/hs_discover && \
mkdir static/js && \
mkdir static/css && \
npm install && \
npm run build && \
mkdir -p static/js && \
mkdir -p static/css && \
cp -rp templates/hs_discover/js static/ && \
cp -rp templates/hs_discover/css static/ && \
cp -p templates/hs_discover/map.js static/js/ && \
echo "----------------js--------------------" && \
ls -l static/js && \
echo "--------------------------------------" && \
echo "----------------css-------------------" && \
ls -l static/css && \
echo "--------------------------------------" && \
cd static/ && \
cp js/app.*.js js/app.js && \
cp js/chunk-vendors.*.js js/chunk-vendors.js
FROM hydroshare/hs_docker_base:305f2fa
COPY --from=node-build /hydroshare /hydroshare
# Set the locale. TODO - remove once we have a better alternative worked out
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen
# https://www.digicert.com/kb/digicert-root-certificates.htm
# Get the .pem file from digicert and add it to the bundle used by certifi
# Could also use the REQUESTS_CA_BUNDLE environment variable to point to the .pem file
# This was needed beacause the certifi release
# 2024.02.02 https://github.com/certifi/python-certifi/releases/tag/2024.02.02
# does not include the GeoTrust TLS RSA CA G1 certificate at the time of this writing
# More info: https://requests.readthedocs.io/en/latest/user/advanced/#ca-certificates
RUN wget -O /usr/lib/ssl/certs/GeoTrustTLSRSACAG1.crt.pem https://cacerts.digicert.com/GeoTrustTLSRSACAG1.crt.pem && \
update-ca-certificates && \
cat /usr/lib/ssl/certs/GeoTrustTLSRSACAG1.crt.pem >> $(python -c "import requests; print(requests.certs.where())")
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
USER root
WORKDIR /hydroshare
CMD ["/bin/bash"]