forked from Qiskit/platypus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (29 loc) · 1.09 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
FROM node:16-alpine AS builder
ARG IBMID_CLIENT_ID
ARG IBMID_CLIENT_SECRET
ARG MONGODB_URI
WORKDIR /usr/app
COPY converter/textbook-converter/requirements.txt converter/textbook-converter/
# py3-pyzmq is needed by pyyaml but pip is not able to compile it
RUN apk add --no-cache g++ linux-headers python3 python3-dev py3-pip py3-pyzmq
RUN python3 -m venv .venv && source .venv/bin/activate
RUN python3 -m pip install -U pip \
&& python3 -m pip install -r converter/textbook-converter/requirements.txt
COPY package*.json ./
COPY patches patches/
RUN npm ci
COPY converter converter/
COPY frontend frontend/
COPY server server/
COPY notebooks notebooks/
COPY translations translations/
COPY config.yaml ./
RUN npm run setup:secrets -- --mongo $MONGODB_URI --ibmClientId $IBMID_CLIENT_ID --ibmClientSecret $IBMID_CLIENT_SECRET
RUN npm run build
# only need to keep all the strings.yaml & *.md files
RUN find ./translations -type f ! -iname "*.yaml" -type f ! -iname "*.md" -delete
FROM node:16-alpine AS runtime
WORKDIR /usr/app
COPY --from=builder /usr/app ./
RUN npm prune --production
CMD ["npm", "start"]