forked from RedisInsight/RedisInsight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.Dockerfile
42 lines (26 loc) · 940 Bytes
/
api.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
FROM node:16.15.1-alpine as build
RUN apk update && apk add bash libsecret dbus-x11 gnome-keyring
RUN dbus-uuidgen > /var/lib/dbus/machine-id
WORKDIR /usr/src/app
COPY redisinsight/api/package.json redisinsight/api/yarn.lock ./
RUN yarn install
COPY redisinsight/api ./
RUN yarn run build:prod
RUN rm -rf node_modules/
RUN yarn install --production
RUN cp .yarnclean.prod .yarnclean && yarn autoclean --force
# Production image
FROM node:16.15.1-alpine as production
RUN apk update && apk add bash libsecret dbus-x11 gnome-keyring
RUN dbus-uuidgen > /var/lib/dbus/machine-id
ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}
ENV BUILD_TYPE='DOCKER_ON_PREMISE'
WORKDIR /usr/src/app
COPY --from=build /usr/src/app/dist ./dist
COPY --from=build /usr/src/app/node_modules ./node_modules
COPY ./api-docker-entry.sh ./
RUN chmod +x api-docker-entry.sh
ENTRYPOINT ["./api-docker-entry.sh"]
CMD ["node", "dist/src/main"]
EXPOSE 5000