forked from fantasticit/think
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
27 lines (24 loc) · 881 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
FROM node:18-alpine as builder
COPY . /app/
WORKDIR /app
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN npm config set registry https://registry.npmmirror.com
RUN npm i -g pm2 @nestjs/cli pnpm
RUN apk --no-cache add bash dos2unix \
&& find . -name "*.sh" -exec dos2unix {} \; \
&& apk del dos2unix
RUN bash build-output.sh
FROM node:18-alpine as prod
ENV TZ=Asia/Shanghai
COPY --from=builder /app/docker/* /app/docker/
COPY --from=builder /app/output/ /app/
WORKDIR /app
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN npm config set registry https://registry.npmmirror.com
RUN set -x \
&& apk update \
&& apk add --no-cache tzdata redis \
&& chmod +x /app/docker/start.sh \
&& npm i -g pm2 @nestjs/cli pnpm \
&& rm -rf /var/cache/apk/*
ENTRYPOINT sh /app/docker/start.sh