-
Notifications
You must be signed in to change notification settings - Fork 150
/
Dockerfile.alpine
35 lines (33 loc) · 1.23 KB
/
Dockerfile.alpine
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
# 詳細については、Dockerfile.debianのコメントを参照。
FROM --platform=$BUILDPLATFORM node:18-alpine AS client-builder
COPY client/package*.json /app/client/
WORKDIR /app/client
RUN npm config set fetch-retries 10 \
&& npm config set fetch-retry-mintimeout 100000 \
&& npm config set fetch-retry-maxtimeout 600000
RUN npm install --no-save --loglevel=info
COPY . /app/
RUN npm run build --loglevel=info
FROM node:18-alpine3.19 AS server-builder
RUN apk add --no-cache g++ make pkgconf python3 py3-pip
# node-sqlite3 が依存する node-gyp が が依存する python3 の distutils 廃止に対応
# node-sqlite3 が依存する node-gyp が v10 以上になれば不要になる
RUN pip install --break-system-pack setuptools
WORKDIR /app
COPY package*.json /app/
ENV DOCKER="YES"
RUN npm config set fetch-retries 10 \
&& npm config set fetch-retry-mintimeout 100000 \
&& npm config set fetch-retry-maxtimeout 600000
RUN npm install --no-save --loglevel=info
COPY . .
RUN rm -rf client
RUN npm run build-server --loglevel=info
FROM node:18-alpine
LABEL maintainer="l3tnun"
COPY --from=server-builder /app /app/
COPY --from=client-builder /app/client /app/client/
EXPOSE 8888
WORKDIR /app
ENTRYPOINT ["npm"]
CMD ["start"]