-
Notifications
You must be signed in to change notification settings - Fork 43
/
Dockerfile
31 lines (21 loc) · 876 Bytes
/
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
######## 构建 ########
FROM node:12.16.3-alpine3.11 as builder
RUN apk add --update --no-cache ca-certificates curl wget cmake build-base git bash python make gcc g++ zlib-dev autoconf automake file nasm \
&& update-ca-certificates
WORKDIR /yapi/vendors
SHELL ["/bin/bash", "-c"]
COPY . .
RUN echo '{"adminAccount":"[email protected]","db":{"servername":"yapi-mongo","port":27017,"DATABASE":"yapi"},"mail":{"enable":false},"ldapLogin":{"enable":false},"closeRegister":true,"plugins":[]}' > /yapi/config.json
RUN npm ci
RUN npm run build-client \
&& yarn tsc --module commonjs --outDir .. --esModuleInterop ./docker/start.ts
RUN cd .. \
&& yarn add deepmerge \
&& shopt -s globstar \
&& rm -rf **/*.{map,lock,log,md,yml}
######## 镜像 ########
FROM node:12.16.3-alpine3.11
WORKDIR /yapi
COPY --from=builder /yapi .
EXPOSE 3000
CMD ["node", "./start.js"]