-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
57 lines (42 loc) · 1.16 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
FROM lsiobase/alpine:3.17 as base
ENV TZ=Etc/GMT
RUN \
echo "**** install build packages ****" && \
apk add --no-cache \
alpine-base \
git \
nodejs \
npm \
yarn \
openssh && \
echo "**** cleanup ****" && \
rm -rf \
/root/.cache \
/tmp/*
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ARG data_dir=/config
VOLUME $data_dir
ENV DATA_DIR=$data_dir
COPY docker/root/ /
WORKDIR /app
FROM base as build
# copy NPM dependencies and install
COPY --chown=abc:abc package.json yarn.lock tsconfig.json ./
COPY --chown=abc:abc patches ./patches
RUN yarn install
COPY --chown=abc:abc . /app
RUN yarn run build && rm -rf node_modules
FROM base as app
COPY --from=build --chown=abc:abc /app /app
COPY --chown=abc:abc patches /app/patches
ENV NODE_ENV=production
ENV COLORED_STD=true
RUN yarn install --omit=dev \
&& npm cache clean --force \
&& chown abc:abc node_modules \
&& rm -rf node_modules/tsx \
&& rm -rf node_modules/typescript \
&& rm -rf node_modules/patch-package \
&& rm -rf node_modules/@types \
&& rm -rf node_modules/@esbuild \
&& rm -rf /usr/local/share/.cache \