forked from AlexSciFier/neonlink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
46 lines (31 loc) · 983 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
FROM --platform=$BUILDPLATFORM node:lts-slim AS ui-build
WORKDIR /app/client
ENV PATH /app/client/node_modules/.bin:$PATH
COPY ./frontend/package*.json ./
RUN npm ci
COPY ./frontend .
RUN npm run build
FROM --platform=$TARGETPLATFORM node:lts-slim AS srv-build
RUN apt-get update && apt-get install python3 make build-essential -y
WORKDIR /app/server
ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}
ENV NPM_CONFIG_LOGLEVEL=warn
COPY ./server/package*.json ./
RUN npm ci --omit=dev
FROM --platform=$TARGETPLATFORM node:lts-slim
WORKDIR /app
USER node
COPY --chown=node ./server ./
COPY --chown=node --from=srv-build /app/server ./
COPY --chown=node --from=ui-build /app/client/build ./public
ARG NODE_ENV=production
ARG FASTIFY_PLUGIN_TIMEOUT=120000
ENV NODE_ENV=${NODE_ENV}
ENV PORT=3333
ENV FASTIFY_BODY_LIMIT=5242880
ENV FASTIFY_ADDRESS=0.0.0.0
ENV FASTIFY_LOG_LEVEL=error
ENV FASTIFY_PLUGIN_TIMEOUT=${FASTIFY_PLUGIN_TIMEOUT}
EXPOSE 3333
CMD [ "node", "server.js" ]