forked from nestoralvarezd/graph-explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
27 lines (27 loc) · 1.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
# syntax=docker/dockerfile:1
FROM amazonlinux:2
ARG host
WORKDIR /
COPY . /graph-explorer/
WORKDIR /graph-explorer
RUN yum install -y curl
RUN curl -sL https://rpm.nodesource.com/setup_16.x | bash -
RUN yum install -y nodejs
RUN yum install -y openssl
RUN npm install -g pnpm
RUN pnpm install
WORKDIR /graph-explorer/packages/graph-explorer-proxy-server/cert-info/
### BEGIN CERT CREATION (The below portion is used to create the self-signed cert so that the workbench and proxy can communicate over https.)
RUN sed -i "21s/$/ $host:*/" csr.conf
RUN sed -i "8s/$/ $host:*/" cert.conf
RUN openssl req -x509 -sha256 -days 356 -nodes -newkey rsa:2048 -subj "/CN=Amazon Neptune/C=US/L=Seattle" -keyout rootCA.key -out rootCA.crt
RUN openssl genrsa -out ./server.key 2048
RUN openssl req -new -key ./server.key -out ./server.csr -config ./csr.conf
RUN openssl x509 -req -in ./server.csr -CA ./rootCA.crt -CAkey ./rootCA.key -CAcreateserial -out ./server.crt -days 365 -sha256 -extfile ./cert.conf
### END CERT CREATION
WORKDIR /graph-explorer/
ENV HOME=/graph-explorer
RUN pnpm build
EXPOSE 443
EXPOSE 80
CMD ["pnpm", "start:proxy-server"]